Changeset 15727 in josm


Ignore:
Timestamp:
2020-01-19T10:54:21+01:00 (5 years ago)
Author:
simon04
Message:

Java 8: use Collection.removeIf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java

    r14654 r15727  
    100100        }
    101101
    102         // If several ways have been found, remove ways that doesn't have selected
    103         // node in the middle
     102        // If several ways have been found, remove ways that do not have selected node in the middle
    104103        if (applicableWays.size() > 1) {
    105             for (Iterator<Way> it = applicableWays.iterator(); it.hasNext();) {
    106                 Way w = it.next();
    107                 for (Node n : selectedNodes) {
    108                     if (!w.isInnerNode(n)) {
    109                         it.remove();
    110                         break;
    111                     }
    112                 }
    113             }
     104             applicableWays.removeIf(w -> selectedNodes.stream().noneMatch(w::isInnerNode));
    114105        }
    115106
Note: See TracChangeset for help on using the changeset viewer.