accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [accumulo] keith-turner commented on a change in pull request #1014: Replace loops that remove with Collection.removeIf
Date Wed, 06 Mar 2019 20:32:57 GMT
keith-turner commented on a change in pull request #1014: Replace loops that remove with Collection.removeIf
URL: https://github.com/apache/accumulo/pull/1014#discussion_r263121863
 
 

 ##########
 File path: server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
 ##########
 @@ -236,12 +236,7 @@ public void run() {
         }
 
         // remove map files that have no more key extents to assign
-        Iterator<Entry<Path,List<KeyExtent>>> afIter = assignmentFailures.entrySet().iterator();
-        while (afIter.hasNext()) {
-          Entry<Path,List<KeyExtent>> entry = afIter.next();
-          if (entry.getValue().size() == 0)
-            afIter.remove();
-        }
+        assignmentFailures.entrySet().removeIf(entry -> entry.getValue().size() == 0);
 
 Review comment:
   may be able to use `assignmentFailures.values()` here

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message