dungba88 opened a new pull request, #13595:
URL: https://github.com/apache/lucene/pull/13595

   ### Description
   
   I think `advance` is usually not called in backward, so we can run the 
binary search from the current position +1 instead of 0. Also cap the fromIndex 
to scoreDocs.length to avoid overflow.
   
   From the Javadoc of `advance`
   
   ```
      * <p>The behavior of this method is <b>undefined</b> when called with 
<code> target &le; current
      * </code>, or after the iterator has exhausted. Both cases may result in 
unpredicted behavior.
   ```


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

Reply via email to