Skip to content

Commit

Permalink
Make find_edge warn for probably bad requests
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Nov 9, 2024
1 parent 3064732 commit 39c53d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions graph/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ impl Graph {

/// Find the Road going from `i1` to `i2` or vice versa
pub fn find_edge(&self, i1: IntersectionID, i2: IntersectionID) -> Option<&Road> {
// TODO Maybe disallow this entirely
if i1 == i2 {
warn!("find_edge({i1:?}, {i2:?}) called -- this might be unintentional");
}

// TODO Store lookup table
for r in &self.intersections[i1.0].roads {
let road = &self.roads[r.0];
Expand Down

0 comments on commit 39c53d3

Please sign in to comment.