JingsongLi commented on a change in pull request #8278: 
[FLINK-12335][Table-runtime]Improvement the performance of class SegmentsUtil
URL: https://github.com/apache/flink/pull/8278#discussion_r285873033
 
 

 ##########
 File path: 
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java
 ##########
 @@ -445,7 +443,7 @@ public static void bitSet(MemorySegment segment, int 
baseOffset, int index) {
         * @param index bit index from base offset.
         */
        public static boolean bitGet(MemorySegment segment, int baseOffset, int 
index) {
-               int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 
3);
+               int offset = baseOffset + (index  >>> 3);
 
 Review comment:
   Can you and a util method like this:
   ```
   /**
        * Given a bit index, return word index containing it.
        */
       private static int wordIndex(int bitIndex) {
           return bitIndex >> ADDRESS_BITS_PER_WORD;
       }
   ```

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