pmpailis commented on code in PR #14922: URL: https://github.com/apache/lucene/pull/14922#discussion_r2192664235
########## lucene/core/src/java/org/apache/lucene/codecs/lucene90/IndexedDISI.java: ########## @@ -719,10 +719,10 @@ boolean intoBitSetWithinBlock(IndexedDISI disi, int upTo, FixedBitSet bitSet, in if (disi.bitSet == null) { disi.bitSet = new FixedBitSet(BLOCK_SIZE); } - - int sourceFrom = disi.doc & 0xFFFF; - int sourceTo = Math.min(upTo - disi.block, BLOCK_SIZE); int destFrom = disi.doc - offset; + int disiTo = upTo - offset > bitSet.length() ? bitSet.length() : upTo; Review Comment: an alternative to this could also be the [original](https://github.com/apache/lucene/commit/e03699acc504d8e945e17dcd20a0e01a8025b112#diff-23a2a0341c4cc485f7cb90e438cd7d41a66456f20cc198292ac869c05224e1feL723) approach, i.e. update upper bound iff `upTo == NO_MORE_DOCS` ``` int disiTo = upTo == DocIdSetIterator.NO_MORE_DOCS ? bitSet.length() : upTo; ``` -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org