romseygeek commented on a change in pull request #2365:
URL: https://github.com/apache/lucene-solr/pull/2365#discussion_r576047139



##########
File path: lucene/core/src/java/org/apache/lucene/search/DoubleValuesSource.java
##########
@@ -617,8 +618,17 @@ public double doubleValue() throws IOException {
         public boolean advanceExact(int doc) throws IOException {
           if (disi.docID() < doc) {
             disi.advance(doc);
+            tpiMatch = null;
           }
-          return disi.docID() == doc && (tpi == null || tpi.matches());
+          if (disi.docID() == doc) {

Review comment:
       Rather than a `Boolean`, how about this?
   ```
   private boolean matched = false; // avoid calling tpi.matches() multiple 
times on a single doc
   ...
   public boolean advanceExact(int doc) throws IOException {
     if (disi.docId() == doc) {
       return matched;
     }
     if (disi.docId() < doc) {
       disi.advance(doc);
     }
     return matched = disi.docId() == doc && (tpi == null || tpi.matches());
   }
   ```




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

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