jpountz commented on PR #14922: URL: https://github.com/apache/lucene/pull/14922#issuecomment-3059219790
> To me the contract here is that caller should guarantee there is no doc between offset + bitset.length() and upTo if offset + bitset.length() < upTo. Maybe we should clarify it in java doc, then there is no difference between current impl and check upTo == NO_MORE_DOCS only. The javadoc says that this method should behave like the default impl. So if there's a matching doc between `offset+bitSet.length()` and `upTo`, it should call bitSet#set on this doc, which should in-turn fail since the index is out of bounds. This is why `BitSetIterator#intoBitSet` falls back to `super.intoBitSet` for any matching doc between `offset+bitSet.length()` and `upTo`. Maybe we can do something similar here? Use an optimized impl only up to `min(upTo, bitSet.length() + offset)` and then delegate to `super.intoBitSet(upTo, bitSet, offset)` for any remaining doc? -- 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