Ignore:
Timestamp:
2017-02-26T00:59:32+01:00 (9 years ago)
Author:
Don-vip
Message:

fix #3346 - improve drastically the performance of fixing duplicate nodes by:

  • caching data sources area computation
  • moving layer invalidation from UndoRedoHandler.addNoRedraw to UndoRedoHandler.add
  • avoiding any EDT call when building tag conflict dialog if it's not meant to be displayed
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java

    r11452 r11627  
    293293        }
    294294
    295         //Delete all relations in the list
     295        // Delete all relations in the list
    296296        relFix.remove(relationToKeep);
    297297        commands.add(new DeleteCommand(relFix));
     
    306306        // We fix it only if there is no more than one relation that is relation member.
    307307        Collection<? extends OsmPrimitive> sel = testError.getPrimitives();
    308         Set<Relation> relations = new HashSet<>();
     308        Set<Relation> rels = new HashSet<>();
    309309
    310310        for (OsmPrimitive osm : sel) {
    311311            if (osm instanceof Relation) {
    312                 relations.add((Relation) osm);
    313             }
    314         }
    315 
    316         if (relations.size() < 2)
     312                rels.add((Relation) osm);
     313            }
     314        }
     315
     316        if (rels.size() < 2)
    317317            return false;
    318318
    319319        int relationsWithRelations = 0;
    320         for (Relation w : relations) {
     320        for (Relation w : rels) {
    321321            List<Relation> rel = OsmPrimitive.getFilteredList(w.getReferrers(), Relation.class);
    322322            if (!rel.isEmpty()) {
Note: See TracChangeset for help on using the changeset viewer.