jpountz commented on a change in pull request #881: LUCENE-8979: Code Cleanup: Use entryset for map iteration wherever possible. - part 2 URL: https://github.com/apache/lucene-solr/pull/881#discussion_r330579524
########## File path: lucene/core/src/java/org/apache/lucene/search/BooleanQuery.java ########## @@ -506,10 +506,10 @@ public Query rewrite(IndexReader reader) throws IOException { @Override public void visit(QueryVisitor visitor) { - for (BooleanClause.Occur occur : clauseSets.keySet()) { - if (clauseSets.get(occur).size() > 0) { - QueryVisitor v = visitor.getSubVisitor(occur, this); - for (Query q : clauseSets.get(occur)) { + for (Map.Entry<Occur, Collection<Query>> entry : clauseSets.entrySet()) { + if (entry.getValue().size() > 0) { + QueryVisitor v = visitor.getSubVisitor(entry.getKey(), this); + for (Query q : entry.getValue()) { Review comment: can you extract variables? ---------------------------------------------------------------- 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 With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org