Ignore:
Timestamp:
2016-11-22T15:42:54+01:00 (7 years ago)
Author:
simon04
Message:

see #14025 - Merge layers performance: run quick/decisive checks first

File:
1 edited

Legend:

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

    r11269 r11292  
    298298    @Override
    299299    public boolean hasEqualSemanticAttributes(OsmPrimitive other, boolean testInterestingTagsOnly) {
    300         if (!(other instanceof Node))
    301             return false;
    302         if (!super.hasEqualSemanticAttributes(other, testInterestingTagsOnly))
    303             return false;
    304         Node n = (Node) other;
    305         LatLon coor = getCoor();
    306         LatLon otherCoor = n.getCoor();
    307         if (coor == null && otherCoor == null)
    308             return true;
    309         else if (coor != null && otherCoor != null)
    310             return coor.equalsEpsilon(otherCoor);
    311         else
    312             return false;
     300        return (other instanceof Node)
     301                && hasEqualSemanticFlags(other)
     302                && hasEqualCoordinates((Node) other)
     303                && super.hasEqualSemanticAttributes(other, testInterestingTagsOnly);
     304    }
     305
     306    private boolean hasEqualCoordinates(Node other) {
     307        final LatLon c1 = getCoor();
     308        final LatLon c2 = other.getCoor();
     309        return (c1 == null && c2 == null) || (c1 != null && c2 != null && c1.equalsEpsilon(c2));
    313310    }
    314311
Note: See TracChangeset for help on using the changeset viewer.