Ignore:
Timestamp:
2022-06-15T19:27:05+02:00 (2 years ago)
Author:
taylor.smock
Message:

Fix #22115: Extract methods from LatLon into ILatLon where they are generally applicable

This also removes calls to Node#getCoor where possible, which reduces
the number of memory allocations in SearchCompiler#match, and overall
allocations due to Node#getCoor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r18211 r18494  
    399399        int w = getWidth()/2;
    400400        int h = getHeight()/2;
    401         LatLon ll1 = getLatLon(w-50, h);
    402         LatLon ll2 = getLatLon(w+50, h);
     401        ILatLon ll1 = getLatLon(w-50, h);
     402        ILatLon ll2 = getLatLon(w+50, h);
    403403        double gcd = ll1.greatCircleDistance(ll2);
    404404        if (alwaysPositive && gcd <= 0)
     
    649649        LatLon ll2 = getLatLon(width / 2 + 50, height / 2);
    650650        if (ll1.isValid() && ll2.isValid() && b.contains(ll1) && b.contains(ll2)) {
    651             double dm = ll1.greatCircleDistance(ll2);
     651            double dm = ll1.greatCircleDistance((ILatLon) ll2);
    652652            double den = 100 * getScale();
    653653            double scaleMin = 0.01 * den / dm / 100;
Note: See TracChangeset for help on using the changeset viewer.