risdenk commented on code in PR #116:
URL: https://github.com/apache/lucene-solr/pull/116#discussion_r1002129826


##########
solr/core/src/java/org/apache/solr/search/QueryResultKey.java:
##########
@@ -49,12 +49,14 @@ public QueryResultKey(Query query, List<Query> filters, 
Sort sort, int nc_flags)
       for (Query filt : filters)
         // NOTE: simple summation used here so keys with the same filters but 
in
         // different orders get the same hashCode
-        h += filt.hashCode();
+        if (filt != null)
+          h += filt.hashCode();
     }
 
     sfields = (this.sort !=null) ? this.sort.getSort() : defaultSort;
     for (SortField sf : sfields) {
-      h = h*29 + sf.hashCode();
+      if (sf != null)
+        h = h*29 + sf.hashCode();

Review Comment:
   add `{}` around for if statement



##########
solr/core/src/java/org/apache/solr/search/QueryResultKey.java:
##########
@@ -49,12 +49,14 @@ public QueryResultKey(Query query, List<Query> filters, 
Sort sort, int nc_flags)
       for (Query filt : filters)
         // NOTE: simple summation used here so keys with the same filters but 
in
         // different orders get the same hashCode
-        h += filt.hashCode();
+        if (filt != null)
+          h += filt.hashCode();

Review Comment:
   add `{}` around for if statement



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