Skip to content

Commit dcb17bc

Browse files
authored
fix: Avoid reallocations when processing tree updates (#482)
1 parent 1fead29 commit dcb17bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

consumer/src/tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl State {
7676

7777
orphans.remove(&node_id);
7878

79-
let mut seen_child_ids = HashSet::new();
79+
let mut seen_child_ids = HashSet::with_capacity(node_data.children().len());
8080
for (child_index, child_id) in node_data.children().iter().enumerate() {
8181
if seen_child_ids.contains(child_id) {
8282
panic!(

0 commit comments

Comments
 (0)