Ticket #18728: 18728.patch

File 18728.patch, 854 bytes (added by GerdP, 4 months ago)
  • src/org/openstreetmap/josm/command/DeleteCommand.java

     
    440440                .collect(Collectors.toSet());
    441441
    442442        Collection<Command> cmds = new LinkedList<>();
     443        Set<Node> nodesToRemove = new HashSet<>(Utils.filteredCollection(primitivesToDelete, Node.class));
    443444        for (Way w : waysToBeChanged) {
    444445            Way wnew = new Way(w);
    445             wnew.removeNodes(new HashSet<>(Utils.filteredCollection(primitivesToDelete, Node.class)));
     446            wnew.removeNodes(nodesToRemove);
    446447            if (wnew.getNodesCount() < 2) {
    447448                primitivesToDelete.add(w);
    448449            } else {