You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/12/27 10:02:08 UTC

[GitHub] [lucene] twosom commented on a diff in pull request #12040: Minor refactoring and cleanup to BooleanQuery code

twosom commented on code in PR #12040:
URL: https://github.com/apache/lucene/pull/12040#discussion_r1057574839


##########
lucene/core/src/java/org/apache/lucene/search/BooleanQuery.java:
##########
@@ -204,11 +204,11 @@ BooleanQuery rewriteNoScoring(IndexSearcher indexSearcher) throws IOException {
     for (BooleanClause clause : clauses) {
       Query query = clause.getQuery();
       Query rewritten = new ConstantScoreQuery(query).rewrite(indexSearcher);
-      if (rewritten instanceof ConstantScoreQuery) {
-        rewritten = ((ConstantScoreQuery) rewritten).getQuery();
+      if (rewritten instanceof ConstantScoreQuery constantScoreQuery) {
+        rewritten = constantScoreQuery.getQuery();
       }
       BooleanClause.Occur occur = clause.getOccur();
-      if (occur == Occur.SHOULD && keepShould == false) {
+      if (occur == Occur.SHOULD && !keepShould) {

Review Comment:
   Thanks to reply.
   I'll keep `== false`😊



-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org