You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ds...@apache.org on 2026/05/06 03:30:33 UTC
(lucene) branch main updated: Optimize QueryVisitor.EMPTY_VISITOR (#16003)
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/main by this push:
new b03bd1fe685 Optimize QueryVisitor.EMPTY_VISITOR (#16003)
b03bd1fe685 is described below
commit b03bd1fe685572fd6a036ee03bcdb50e1c6d4108
Author: David Smiley <ds...@apache.org>
AuthorDate: Tue May 5 23:30:28 2026 -0400
Optimize QueryVisitor.EMPTY_VISITOR (#16003)
Return false for acceptField.
---
lucene/core/src/java/org/apache/lucene/search/QueryVisitor.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lucene/core/src/java/org/apache/lucene/search/QueryVisitor.java b/lucene/core/src/java/org/apache/lucene/search/QueryVisitor.java
index ac4074ba798..a97544fda45 100644
--- a/lucene/core/src/java/org/apache/lucene/search/QueryVisitor.java
+++ b/lucene/core/src/java/org/apache/lucene/search/QueryVisitor.java
@@ -98,5 +98,11 @@ public abstract class QueryVisitor {
}
/** A QueryVisitor implementation that does nothing */
- public static final QueryVisitor EMPTY_VISITOR = new QueryVisitor() {};
+ public static final QueryVisitor EMPTY_VISITOR =
+ new QueryVisitor() {
+ @Override
+ public boolean acceptField(String field) {
+ return false;
+ }
+ };
}