Remove some useless code in TopScoreDocCollector. (#13955)

This commit is contained in:
Adrien Grand 2024-10-25 13:30:49 +02:00 committed by GitHub
parent 8362f609b2
commit 2268242412
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -254,11 +254,13 @@ public abstract class TopScoreDocCollector extends TopDocsCollector<ScoreDoc> {
}
protected void updateMinCompetitiveScore(Scorable scorer) throws IOException {
if (hitsThresholdChecker.isThresholdReached()
&& pqTop != null
&& pqTop.score != Float.NEGATIVE_INFINITY) { // -Infinity is the score of sentinels
if (hitsThresholdChecker.isThresholdReached()) {
// since we tie-break on doc id and collect in doc id order, we can require
// the next float
// pqTop is never null since TopScoreDocCollector fills the priority queue with sentinel
// values
// if the top element is a sentinel value, its score will be -Infty and the below logic is
// still valid
float localMinScore = Math.nextUp(pqTop.score);
if (localMinScore > minCompetitiveScore) {
scorer.setMinCompetitiveScore(localMinScore);