javanna commented on code in PR #16215:
URL: https://github.com/apache/lucene/pull/16215#discussion_r3372790614


##########
lucene/test-framework/src/java/org/apache/lucene/tests/search/QueryUtils.java:
##########
@@ -641,34 +561,42 @@ protected void doSetNextReader(LeafReaderContext context) 
throws IOException {
         });
 
     if (lastReader[0] != null) {
-      // confirm that skipping beyond the last doc, on the
-      // previous reader, hits NO_MORE_DOCS
-      final LeafReader previousReader = lastReader[0];
-      IndexSearcher indexSearcher = LuceneTestCase.newSearcher(previousReader, 
false);
-      indexSearcher.setSimilarity(s.getSimilarity());
-      Weight w = indexSearcher.createWeight(rewritten, ScoreMode.COMPLETE, 1);
-      Scorer scorer = w.scorer((LeafReaderContext) 
indexSearcher.getTopReaderContext());
-      if (scorer != null) {
-        DocIdSetIterator iterator = scorer.iterator();
-        boolean more = false;
-        final Bits liveDocs = lastReader[0].getLiveDocs();
-        for (int d = iterator.advance(lastDoc[0] + 1);
-            d != DocIdSetIterator.NO_MORE_DOCS;
-            d = iterator.nextDoc()) {
-          if (liveDocs == null || liveDocs.get(d)) {
-            more = true;
-            break;
-          }

Review Comment:
   This above looks like a straightforward 1:1 replacement. Removes the code 
duplication and prepares the code for further refactoring down the line.



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

Reply via email to