Skip to content

Commit

Permalink
Silence warning about loop edges
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Sep 1, 2024
1 parent 66c93f3 commit 29cd7dc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions graph/src/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ impl Router {
let node1 = node_map.get_or_insert(road.src_i);
let node2 = node_map.get_or_insert(road.dst_i);

// Loops aren't ever part of a shortest path, and fast_paths warns loudly, so just skip
if node1 == node2 {
continue;
}

if road.allows_forwards(mode) {
input_graph.add_edge(node1, node2, cost);
}
Expand Down

0 comments on commit 29cd7dc

Please sign in to comment.