Changeset 14887 in josm


Ignore:
Timestamp:
2019-03-15T10:06:19+01:00 (7 months ago)
Author:
GerdP
Message:

see #17342: improve performance: check if selection is empty before searching error list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java

    r14858 r14887  
    219219        void updateEnabledState() {
    220220            boolean found = false;
    221             for (TestError e : tree.getErrors()) {
    222                 for (OsmPrimitive p : e.getPrimitives()) {
    223                     if (p.isSelected()) {
    224                         found = true;
    225                         break;
     221            final DataSet ds = MainApplication.getLayerManager().getActiveDataSet();
     222            if (ds != null && !ds.selectionEmpty()) {
     223                for (TestError e : tree.getErrors()) {
     224                    for (OsmPrimitive p : e.getPrimitives()) {
     225                        if (p.isSelected()) {
     226                            found = true;
     227                            break;
     228                        }
    226229                    }
    227230                }
Note: See TracChangeset for help on using the changeset viewer.