Fix unwanted duplicate node in existing vec

Broken in previous commit. This is now only a few percentage points
performance win, but it's still a net improvement.
pull/708/head
Wilfred Hughes 2024-04-28 16:35:40 +07:00
parent d15d593708
commit 8655a9464e
1 changed files with 1 additions and 2 deletions

@ -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