Simplify code using Java 8 features
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / entityownership / EntityOwnershipShardCommitCoordinator.java
index 4e344cd..f3adfbd 100644 (file)
@@ -222,13 +222,7 @@ class EntityOwnershipShardCommitCoordinator {
             }
 
             // Prune the subsequent pending modifications.
-            Iterator<Modification> iter = pendingModifications.iterator();
-            while (iter.hasNext()) {
-                Modification mod = iter.next();
-                if (!canForwardModificationToNewLeader(mod)) {
-                    iter.remove();
-                }
-            }
+            pendingModifications.removeIf(mod -> !canForwardModificationToNewLeader(mod));
         }
     }
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.