Changeset 17802 in josm for trunk/src


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

see #20745 - Avoid heap allocations in MapCSS MatchingReferrerFinder due to Environment.withPrimitive

9.7% of MapCSSTagCheckerPerformanceTest#testCity amount to Environment.withPrimitive

File:
1 edited

Legend:

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

    r17801 r17802  
    214214                if (e.parent != null) return;
    215215
    216                 if (!left.matches(e.withPrimitive(parent)))
    217                     return;
     216                IPrimitive osm = e.osm;
     217                try {
     218                    e.osm = parent;
     219                    if (!left.matches(e))
     220                        return;
     221                } catch (Exception exception) {
     222                    e.osm = osm;
     223                }
    218224                int count = parent instanceof IWay<?>
    219225                        ? ((IWay<?>) parent).getNodesCount()
Note: See TracChangeset for help on using the changeset viewer.