Ignore:
Timestamp:
2016-11-28T21:18:55+01:00 (4 years ago)
Author:
simon04
Message:

Loop can be replaced with Collection.removeIf()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/DeleteCommand.java

    r11240 r11339  
    1414import java.util.HashMap;
    1515import java.util.HashSet;
    16 import java.util.Iterator;
    1716import java.util.LinkedList;
    1817import java.util.List;
     
    439438        if (!silent) {
    440439            Set<RelationToChildReference> references = RelationToChildReference.getRelationToChildReferences(primitivesToDelete);
    441             Iterator<RelationToChildReference> it = references.iterator();
    442             while (it.hasNext()) {
    443                 RelationToChildReference ref = it.next();
    444                 if (ref.getParent().isDeleted()) {
    445                     it.remove();
    446                 }
    447             }
     440            references.removeIf(ref -> ref.getParent().isDeleted());
    448441            if (!references.isEmpty()) {
    449442                DeleteFromRelationConfirmationDialog dialog = DeleteFromRelationConfirmationDialog.getInstance();
Note: See TracChangeset for help on using the changeset viewer.