File tree 1 file changed +8
-6
lines changed
lucene/core/src/java/org/apache/lucene/search 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -304,18 +304,20 @@ private void scoreWindowUsingLeapFrog(
304
304
int min ,
305
305
int max )
306
306
throws IOException {
307
+ assert twoPhases .size () > 0 ;
308
+ assert approximations .size () > twoPhases .size ();
309
+
307
310
if (approximations .size () == 1 ) {
308
- // Since a TwoPhaseIterator comes with its approximation, the number of approximations is gte
309
- // the number of TwoPhaseIterators
310
- assert twoPhases .size () < = 1 ;
311
+ // scoreWindowUsingLeapFrog is only used if there is at least one two-phase iterator, so our
312
+ // single clause is a two-phase iterator
313
+ assert twoPhases .size () = = 1 ;
311
314
DocIdSetIterator approximation = approximations .get (0 );
312
- TwoPhaseIterator twoPhase = twoPhases .isEmpty () ? null : twoPhases . get (0 );
315
+ TwoPhaseIterator twoPhase = twoPhases .get (0 );
313
316
if (approximation .docID () < min ) {
314
317
approximation .advance (min );
315
318
}
316
319
for (int doc = approximation .docID (); doc < max ; doc = approximation .nextDoc ()) {
317
- if ((acceptDocs == null || acceptDocs .get (doc ))
318
- && (twoPhase == null || twoPhase .matches ())) {
320
+ if ((acceptDocs == null || acceptDocs .get (doc )) && twoPhase .matches ()) {
319
321
collector .collect (doc );
320
322
}
321
323
}
You can’t perform that action at this time.
0 commit comments