magibney commented on a change in pull request #592:
URL: https://github.com/apache/solr/pull/592#discussion_r802986004
##########
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:
Oops, was adding to `seen` but never checking it. The purpose should be
clarified by 6074c5dc80a1984de74254b88fa7a748c1624735.
It is possible in theory to create a `WrappedQuery` that at some level wraps
itself (perhaps indirectly). I'd be more than happy to get rid of this ... do
you think it would be safe to do so?
--
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]