dsmiley commented on a change in pull request #592:
URL: https://github.com/apache/solr/pull/592#discussion_r802990106
##########
File path: solr/core/src/java/org/apache/solr/search/QueryUtils.java
##########
@@ -54,23 +54,7 @@ public static boolean isNegative(Query q) {
* varying score (i.e., it is a constant score query).
*/
public static boolean isConstantScoreQuery(Query q) {
- return isConstantScoreQuery(q, null);
- }
-
- private static Map<Query, Void> lazyInitSeen(Map<Query, Void> seen, Query
add) {
- if (seen == null) {
- seen = new IdentityHashMap<>();
- }
- seen.put(add, null);
- return seen;
- }
-
- /**
- * Returns true if the specified query is guaranteed to assign the same
score to all docs; otherwise false
- * @param q query to be evaluated
- * @param seen used to detect possible loops in nested query input
- */
- private static boolean isConstantScoreQuery(Query q, Map<Query, Void> seen) {
+ Map<Query, Void> seen = null; // lazy-init; this will be unnecessary in
many cases
Review comment:
I'd remove these comments as well. I've never seen this loop checking
done before for Queries and I've never seen a Query try to prevent this.
--
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]