Ignore:
Timestamp:
2009-11-07T18:01:20+01:00 (15 years ago)
Author:
jttt
Message:

Remove some unnecessary calls to fireSelectionChanged()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

    r2401 r2402  
    783783
    784784    public void clenupDeletedPrimitives() {
    785         cleanupDeleted(nodes.iterator());
    786         cleanupDeleted(ways.iterator());
    787         cleanupDeleted(relations.iterator());
    788     }
    789 
    790     private void cleanupDeleted(Iterator<? extends OsmPrimitive> it) {
     785        if (cleanupDeleted(nodes.iterator())
     786                | cleanupDeleted(ways.iterator())
     787                | cleanupDeleted(relations.iterator())) {
     788            fireSelectionChanged();
     789        }
     790    }
     791
     792    private boolean cleanupDeleted(Iterator<? extends OsmPrimitive> it) {
     793        boolean changed = false;
    791794        while (it.hasNext()) {
    792             if (it.next().isDeleted()) {
     795            OsmPrimitive primitive = it.next();
     796            if (primitive.isDeleted()) {
     797                selectedPrimitives.remove(primitive);
     798                allPrimitives.remove(primitive);
     799                changed = true;
    793800                it.remove();
    794801            }
    795802        }
     803        return changed;
    796804    }
    797805
Note: See TracChangeset for help on using the changeset viewer.