Skip to content

Commit

Permalink
Fix excess capacity reservation in Graph::with_capacity
Browse files Browse the repository at this point in the history
The passed node count should only be used to reserve space in collections that
will have an entry for all or most nodes. That doesn't include the list of
input, output and capture node IDs.
  • Loading branch information
robertknight committed Nov 30, 2024
1 parent 35e119e commit b226873
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,9 @@ impl Graph {
nodes: Vec::with_capacity(n_nodes),
cached_plan: Mutex::new(None),
source_ids: FxHashMap::default(),
input_ids: Vec::with_capacity(n_nodes),
output_ids: Vec::with_capacity(n_nodes),
captures: Vec::with_capacity(n_nodes),
input_ids: Vec::new(),
output_ids: Vec::new(),
captures: Vec::new(),
node_id_from_name: HashMap::with_capacity(n_nodes),
}
}
Expand Down

0 comments on commit b226873

Please sign in to comment.