dsmiley commented on a change in pull request #1467: URL: https://github.com/apache/lucene-solr/pull/1467#discussion_r417440312
########## File path: lucene/core/src/java/org/apache/lucene/search/FuzzyQuery.java ########## @@ -237,22 +216,9 @@ public boolean equals(Object obj) { if (getClass() != obj.getClass()) return false; FuzzyQuery other = (FuzzyQuery) obj; - // Note that we don't need to compare termLength or automata because they - // are entirely determined by the other fields - if (maxEdits != other.maxEdits) - return false; - if (prefixLength != other.prefixLength) - return false; - if (maxExpansions != other.maxExpansions) - return false; - if (transpositions != other.transpositions) - return false; - if (term == null) { - if (other.term != null) - return false; - } else if (!term.equals(other.term)) - return false; - return true; + return Objects.equals(maxEdits, other.maxEdits) && Objects.equals(prefixLength, other.prefixLength) Review comment: nitpick: compare the term first, as it is most likely to return false for different fuzzy ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org