Changeset 15182 in josm


Ignore:
Timestamp:
2019-06-18T03:00:04+02:00 (4 months ago)
Author:
Don-vip
Message:

see #17819 - minor performance improvement, avoid to compute size twice

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java

    r15178 r15182  
    186186            this.nodes = new ArrayList<>(nodes);
    187187            // see #17819
    188             if (wayIds.size() == 1) {
     188            final int size = wayIds.size();
     189            if (size == 1) {
    189190                this.wayIds = Collections.singleton(wayIds.iterator().next());
    190191            } else {
    191                 this.wayIds = wayIds.size() <= 10 ? new ArrayList<>(wayIds) : new HashSet<>(wayIds);
     192                this.wayIds = size <= 10 ? new ArrayList<>(wayIds) : new HashSet<>(wayIds);
    192193            }
    193194            this.selected = selected;
Note: See TracChangeset for help on using the changeset viewer.