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:49:10 UTC
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1014:
Replace loops that remove with Collection.removeIf
ctubbsii commented on a change in pull request #1014: Replace loops that remove with Collection.removeIf
URL: https://github.com/apache/accumulo/pull/1014#discussion_r263128412
##########
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:
Is there an isEmpty() instead? Perhaps: `.removeIf(entry.getValue()::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