leventov commented on a change in pull request #7067: Made IntelliJ Inspection 
"Iteration over keySet() could be replaced with entrySet()" a error & Fixed the 
violations
URL: https://github.com/apache/incubator-druid/pull/7067#discussion_r262235987
 
 

 ##########
 File path: 
benchmarks/src/main/java/org/apache/druid/benchmark/query/SelectBenchmark.java
 ##########
 @@ -278,8 +278,9 @@ private SelectQuery incrementQueryPagination(SelectQuery 
query, SelectResultValu
     Map<String, Integer> pagingIdentifiers = prevResult.getPagingIdentifiers();
     Map<String, Integer> newPagingIdentifers = new HashMap<>();
 
-    for (String segmentId : pagingIdentifiers.keySet()) {
-      int newOffset = pagingIdentifiers.get(segmentId) + 1;
+    for (Map.Entry<String, Integer> entry : pagingIdentifiers.entrySet()) {
 
 Review comment:
   `pagingIdentifiers.replaceAll((id, offset) -> offset + 1);` should replace 
the whole loop, not be done on every iteration.
   
   @hpandeycodeit please read your code with fresh eye every time before 
committing.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to