Changeset 17799 in josm for trunk/src/org


Ignore:
Timestamp:
2021-04-19T21:45:09+02:00 (4 years ago)
Author:
simon04
Message:

see #20745 - Avoid some heap allocations in MapCSS KeyRegexpCondition.applies

14.32% -> 9.42% in MapCSSTagCheckerPerformanceTest#testCity amount to KeyRegexpCondition.applies

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java

    r17765 r17799  
    645645        @Override
    646646        public boolean applies(Tagged osm) {
    647             return osm.keys().anyMatch(pattern.asPredicate()) ^ negateResult;
     647            boolean matches = osm.hasKeys() && osm.keys().anyMatch(pattern.asPredicate());
     648            return matches ^ negateResult;
    648649        }
    649650
Note: See TracChangeset for help on using the changeset viewer.