You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/03/06 20:56:37 UTC

[GitHub] [accumulo] mikewalch commented on a change in pull request #1014: Replace loops that remove with Collection.removeIf

mikewalch commented on a change in pull request #1014: Replace loops that remove with Collection.removeIf
URL: https://github.com/apache/accumulo/pull/1014#discussion_r263131037
 
 

 ##########
 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:
   my update uses isEmpty()

----------------------------------------------------------------
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