Changeset 15874 in josm for trunk


Ignore:
Timestamp:
2020-02-17T14:33:26+01:00 (5 years ago)
Author:
GerdP
Message:

see #18728: Join overlapping Areas is slow when combining many complex ways
Improve performance of DeleteCommand.delete() when thousands of ways are removed

Don't calculate set of nodes inside the loop which adds delete commands for the ways, the set doesn't change in this loop.

File:
1 edited

Legend:

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

    r14654 r15874  
    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);
Note: See TracChangeset for help on using the changeset viewer.