Changeset 13513 in josm
- Timestamp:
- 2018-03-11T14:21:34+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/PurgeCommand.java
r13420 r13513 160 160 public static List<OsmPrimitive> topoSort(Collection<OsmPrimitive> sel) { 161 161 Set<OsmPrimitive> in = new HashSet<>(sel); 162 163 162 List<OsmPrimitive> out = new ArrayList<>(in.size()); 163 Set<Relation> inR = new HashSet<>(); 164 164 165 165 // Nodes not deleted in the first pass … … 201 201 } 202 202 out.add(w); 203 } else if (u instanceof Relation) { 204 inR.add((Relation) u); 203 205 } 204 206 } … … 207 209 throw new AssertionError("topo sort algorithm failed (nodes remaining)"); 208 210 209 /** 210 * Rest are relations. Do topological sorting on a DAG where each 211 * arrow points from child to parent. (Because it is faster to 212 * loop over getReferrers() than getMembers().) 213 */ 214 @SuppressWarnings({ "unchecked", "rawtypes" }) 215 Set<Relation> inR = (Set) in; 211 // Do topological sorting on a DAG where each arrow points from child to parent. 212 // (Because it is faster to loop over getReferrers() than getMembers().) 216 213 217 214 Map<Relation, Integer> numChilds = new HashMap<>();
Note:
See TracChangeset
for help on using the changeset viewer.