kinow commented on a change in pull request #247:
URL: https://github.com/apache/commons-compress/pull/247#discussion_r806110136



##########
File path: 
src/main/java/org/apache/commons/compress/harmony/pack200/BHSDCodec.java
##########
@@ -308,11 +308,8 @@ public boolean encodes(final long value) {
             }
         } else if (z < 0) {
             // Need to use integer overflow here to represent negatives.
-            if (cardinality < 4294967296L) {
-                z += cardinality;
-            } else {
-                z += 4294967296L; // this value is equal to (1 << 32).
-            }
+            // this value is equal to (1 << 32).

Review comment:
       Wrong comment, I think. `1 << 32` is `4294967296L`.
   
   
![image](https://user-images.githubusercontent.com/304786/153921096-1dfa799e-b6ce-4bad-aa39-54d7546a6dc8.png)
   
   After this change it could be interpreted as `z` being `1 << 32`. Maybe 
change the text to `4294967296 is 1 << 32` (which helps devs with the 
magic-numbers issue)
   
   




-- 
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.

To unsubscribe, e-mail: [email protected]

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


Reply via email to