Ignore:
Timestamp:
2017-09-15T01:20:41+02:00 (7 years ago)
Author:
Don-vip
Message:

see #11390 - SonarQube - squid:S3824 - "Map.get" and value test should be replaced with single method call

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/ImageWarp.java

    r12798 r12865  
    9191
    9292        private Point2D getValue(int xIdx, int yIdx) {
    93             Map<Integer, Point2D> row = getRow(yIdx);
    94             Point2D val = row.get(xIdx);
    95             if (val == null) {
    96                 val = trfm.transform(new Point2D.Double(xIdx * stride, yIdx * stride));
    97                 row.put(xIdx, val);
    98             }
    99             return val;
     93            return getRow(yIdx).computeIfAbsent(xIdx, k -> trfm.transform(new Point2D.Double(xIdx * stride, yIdx * stride)));
    10094        }
    10195
Note: See TracChangeset for help on using the changeset viewer.