Ignore:
Timestamp:
2011-12-21T12:58:59+01:00 (12 years ago)
Author:
Don-vip
Message:

see #7159 - Layer merging performance

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java

    r4682 r4684  
    648648     */
    649649    public boolean hasSameTags(OsmPrimitive other) {
    650         return getKeys().equals(other.getKeys());
     650        // We cannot directly use Arrays.equals(keys, other.keys) as keys is not ordered by key
     651        // but we can at least check if both arrays are null or of the same size before creating
     652        // and comparing the key maps (costly operation, see #7159)
     653        return (keys == null && other.keys == null)
     654            || (keys != null && other.keys != null && keys.length == other.keys.length && (keys.length == 0 || getKeys().equals(other.getKeys())));
    651655    }
    652656
Note: See TracChangeset for help on using the changeset viewer.