Skip to content

Commit

Permalink
Remove optimization which gives worst benchmark results
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu committed Jan 20, 2023
1 parent d16d4d2 commit 808b951
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/directed/dijkstra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,11 @@ where
let mut target_reached = None;
while let Some(SmallestHolder { cost, index }) = to_see.pop() {
let successors = {
let (node, &(_, c)) = parents.get_index(index).unwrap();
let (node, _) = parents.get_index(index).unwrap();
if stop(node) {
target_reached = Some(index);
break;
}
// We may have inserted a node several time into the binary heap if we found
// a better way to access it. Ensure that we are currently dealing with the
// best path and discard the others.
if cost > c {
continue;
}
successors(node)
};
for (successor, move_cost) in successors {
Expand Down

0 comments on commit 808b951

Please sign in to comment.