Skip to content

Commit

Permalink
fix: Avoid reallocations when processing tree updates (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
DataTriny authored Nov 23, 2024
1 parent 1fead29 commit dcb17bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion consumer/src/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl State {

orphans.remove(&node_id);

let mut seen_child_ids = HashSet::new();
let mut seen_child_ids = HashSet::with_capacity(node_data.children().len());
for (child_index, child_id) in node_data.children().iter().enumerate() {
if seen_child_ids.contains(child_id) {
panic!(
Expand Down

0 comments on commit dcb17bc

Please sign in to comment.