Changeset 15611 in josm for trunk/src/org
- Timestamp:
- 2019-12-24T11:33:02+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r15605 r15611 986 986 if (predicate.test(n) 987 987 && (dist = getPoint2D(n).distanceSq(p)) < snapDistanceSq) { 988 List<Node> nlist; 989 if (nearestMap.containsKey(dist)) { 990 nlist = nearestMap.get(dist); 991 } else { 992 nlist = new LinkedList<>(); 993 nearestMap.put(dist, nlist); 994 } 995 nlist.add(n); 988 nearestMap.computeIfAbsent(dist, k -> new LinkedList<>()).add(n); 996 989 } 997 990 } … … 1224 1217 1225 1218 if (perDistSq < snapDistanceSq && a < c + snapDistanceSq && b < c + snapDistanceSq) { 1226 List<WaySegment> wslist; 1227 if (nearestMap.containsKey(perDistSq)) { 1228 wslist = nearestMap.get(perDistSq); 1229 } else { 1230 wslist = new LinkedList<>(); 1231 nearestMap.put(perDistSq, wslist); 1232 } 1233 wslist.add(new WaySegment(w, i)); 1219 nearestMap.computeIfAbsent(perDistSq, k -> new LinkedList<>()).add(new WaySegment(w, i)); 1234 1220 } 1235 1221
Note:
See TracChangeset
for help on using the changeset viewer.