Skip to content

Commit

Permalink
Fix unwanted duplicate node in existing vec
Browse files Browse the repository at this point in the history
Broken in previous commit. This is now only a few percentage points
performance win, but it's still a net improvement.
  • Loading branch information
Wilfred committed Apr 28, 2024
1 parent d15d593 commit 8655a94
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/diff/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,7 @@ fn allocate_if_new<'s, 'b>(
//
// We still use a vec to enable experiments with the value
// of how many possible parenthesis nestings to explore.
let mut existing: SmallVec<[&'b Vertex<'s, 'b>; 2]> = smallvec![&*allocated];
existing.push(allocated);
let existing: SmallVec<[&'b Vertex<'s, 'b>; 2]> = smallvec![&*allocated];

vacant.insert(allocated, existing);
allocated
Expand Down

0 comments on commit 8655a94

Please sign in to comment.