zht0209 opened a new issue #9325:
URL: https://github.com/apache/shardingsphere/issues/9325


    public synchronized long getEndIndex(final long fromIndex, final int size) {
           if (size == 0) {
               return fromIndex;
           }
           int correctIndex = (int) (fromIndex - startIndex);
           int listIndex = correctIndex / BIT_SET_SIZE;
           int count = size;
     
           for (int i = listIndex; i < bitSets.size(); i++) {
               int begin = i == listIndex ? correctIndex % BIT_SET_SIZE : 0;
               for (int j = begin; j < BIT_SET_SIZE; j++) {
                   if (bitSets.get(i).get(j) && --count == 0) {
                       return startIndex + i * BIT_SET_SIZE + j + 1;
                   }
               }
           }
           throw new IndexOutOfBoundsException(String.format("BitSets(%s) do 
not have enough data from %d count %d", bitSets, correctIndex, size));
       }
   
   当fronIndex< startIndex,listIndex会小于0


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