Changeset 15558 in josm for trunk/src/org
- Timestamp:
- 2019-12-04T11:42:24+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/NodeGraph.java
r15556 r15558 221 221 } 222 222 223 private List<NodePair> getConnectedPairs (Node node) { 224 List<NodePair> connected = new ArrayList<>(); 225 connected.addAll(Optional.ofNullable(successors.get(node)).orElseGet(Collections::emptyList)); 226 connected.addAll(Optional.ofNullable(predecessors.get(node)).orElseGet(Collections::emptyList)); 227 return connected; 228 } 229 223 230 protected List<NodePair> getOutboundPairs(NodePair pair) { 224 231 return getOutboundPairs(pair.getB()); … … 340 347 Node n = toVisit.pop(); 341 348 if (!visited.contains(n)) { 342 List<NodePair> neighbours = getOutboundPairs(n); 343 for (NodePair pair : neighbours) { 344 toVisit.addLast(pair.getA()); 345 toVisit.addLast(pair.getB()); 349 for (NodePair pair : getConnectedPairs(n)) { 350 if (n != pair.getA()) 351 toVisit.addLast(pair.getA()); 352 if (n != pair.getB()) 353 toVisit.addLast(pair.getB()); 346 354 } 347 355 visited.add(n);
Note:
See TracChangeset
for help on using the changeset viewer.