Changeset 2633 in josm for trunk/src


Ignore:
Timestamp:
2009-12-14T15:30:24+01:00 (12 years ago)
Author:
mjulius
Message:

small optimization - use DataSet.getSelectedWays() instead of iterating over all primitives

File:
1 edited

Legend:

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

    r2348 r2633  
    22package org.openstreetmap.josm.actions;
    33
     4import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    45import static org.openstreetmap.josm.tools.I18n.tr;
    5 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    66
    77import java.awt.event.ActionEvent;
     
    2020import org.openstreetmap.josm.corrector.ReverseWayTagCorrector;
    2121import org.openstreetmap.josm.corrector.UserCancelException;
    22 import org.openstreetmap.josm.data.osm.DataSet;
    2322import org.openstreetmap.josm.data.osm.Node;
    2423import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    4039            return;
    4140
    42         final Collection<Way> sel = new LinkedList<Way>();
    43         for (OsmPrimitive primitive : getCurrentDataSet().getSelected()) {
    44             if (primitive instanceof Way) {
    45                 sel.add((Way)primitive);
    46             }
    47         }
     41        final Collection<Way> sel = getCurrentDataSet().getSelectedWays();
    4842        if (sel.isEmpty()) {
    4943            JOptionPane.showMessageDialog(
Note: See TracChangeset for help on using the changeset viewer.