poorbarcode commented on code in PR #4140:
URL: https://github.com/apache/bookkeeper/pull/4140#discussion_r1413019073


##########
circe-checksum/src/main/java/com/scurrilous/circe/checksum/Java9IntHash.java:
##########
@@ -106,14 +107,22 @@ public int resume(int current, ByteBuf buffer, int 
offset, int len) {
         } else if (buffer.hasArray()) {
             int arrayOffset = buffer.arrayOffset() + offset;
             negCrc = resume(negCrc, buffer.array(), arrayOffset, len);
+        } else if (buffer instanceof CompositeByteBuf) {
+           CompositeByteBuf compositeByteBuf = (CompositeByteBuf) buffer;
+           for (int i = 0; i < compositeByteBuf.numComponents(); i ++) {
+               negCrc = resume(~negCrc, compositeByteBuf.component(i));

Review Comment:
   Sorry, it is a bug(the test didn't cover it because 
[here](https://github.com/apache/bookkeeper/pull/4140#discussion_r1413011583)). 
I rewrote `~negCrc` to `loopedCurrent`, the bug has been fixed and it is easier 
to read now.



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