Skip to content

Commit

Permalink
Fix root path comparison off by one
Browse files Browse the repository at this point in the history
  • Loading branch information
Glirastes authored Nov 13, 2023
1 parent 8970cae commit 7f52816
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/directed/yen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ where

let mut filtered_edges = HashSet::new();
for path in &routes {
if path.nodes.len() > i + 1 && &path.nodes[0..i] == root_path {
if path.nodes.len() > i + 1
&& &path.nodes[0..i] == root_path
&& &path.nodes[i] == spur_node {
filtered_edges.insert((&path.nodes[i], &path.nodes[i + 1]));
}
}
Expand Down

0 comments on commit 7f52816

Please sign in to comment.