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 ≤ 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]