Ignore:
Timestamp:
2016-03-15T09:15:57+01:00 (4 years ago)
Author:
Don-vip
Message:

sonar - do not copy collection contents from one to another with a loop

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
3 edited

Legend:

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

    r9948 r9999  
    305305        final Set<Node> allNodes = new HashSet<>();
    306306        for (WayData w : wayDataList) {
    307             for (Node n : w.wayNodes) {
    308                 allNodes.add(n);
    309             }
     307            allNodes.addAll(w.wayNodes);
    310308        }
    311309
  • trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java

    r9062 r9999  
    147147
    148148        boolean selectionChanged = false;
    149         Collection<OsmPrimitive> selection = new LinkedList<>();
    150         for (OsmPrimitive primitive : currentSelection) {
    151             selection.add(primitive);
    152         }
     149        Collection<OsmPrimitive> selection = new LinkedList<>(currentSelection);
    153150
    154151        do {
  • trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java

    r9968 r9999  
    586586        newWays.remove(wayToKeep);
    587587
     588        newSelection.addAll(newWays);
    588589        for (Way wayToAdd : newWays) {
    589590            commandList.add(new AddCommand(layer, wayToAdd));
    590             newSelection.add(wayToAdd);
    591591        }
    592592
Note: See TracChangeset for help on using the changeset viewer.