aherbert commented on pull request #137:
URL: https://github.com/apache/commons-imaging/pull/137#issuecomment-825879196


   It is more about the visual layout of either side of the operation:
   ```java
   result[offset + 3] = (byte) (value >> 24);
   result[offset + 2] = (byte) (value >> 16);
   result[offset + 1] = (byte) (value >> 8);
   result[offset + 0] = (byte) (value >> 0);
   ```
   becomes:
   ```java
   result[offset + 3] = (byte) (value >> 24);
   result[offset + 2] = (byte) (value >> 16);
   result[offset + 1] = (byte) (value >> 8);
   result[offset    ] = (byte) (value);
   ```
   
   If you keep the formatting using spaces for layout purposes where you have 
removed redundant operations that makes the code clearer.
   
   If you are going to remove all the `+ 0` occurrences then you should remove 
all the ` >> 0` and ` << 0` bit shifts which are also redundant.
   
   I believe this:
   ```java
                           final int index = (u << (precision * 2))
                                   | (j << (precision * 1))
                                   | (k << (precision * 0));
   ```
   has more information about the code intension than:
   ```java
                           final int index = (u << (precision * 2))
                                   | (j << precision)
                                   | k;
   ```
   
   If you prefer the later then please update the PR to remove all the shifts 
by zero and maintain alignment of the source for clarity.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to