liyafan82 commented on a change in pull request #8613: [FLINK-12730][Runtime / 
Coordination] Combine BitSet implementations in flink-runtime
URL: https://github.com/apache/flink/pull/8613#discussion_r300910263
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/operators/util/BitSet.java
 ##########
 @@ -89,8 +88,13 @@ public int bitSize() {
         * Clear the bit set.
         */
        public void clear() {
-               for (int i = 0; i < byteLength; i++) {
-                       memorySegment.put(offset + i, (byte) 0);
+               int index = 0;
+               while (index < byteLength) {
 
 Review comment:
   @StefanRRichter , thanks a lot for your careful review. 
   
   It is a real bug. I have fixed it. In addition, I have added test cases by 
making BitSetTest parameterized. So the clear method is tested against 
different amounts of bits. 
   

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


With regards,
Apache Git Services

Reply via email to