diff --git a/consumer/src/tree.rs b/consumer/src/tree.rs index c66f45c2..f4768988 100644 --- a/consumer/src/tree.rs +++ b/consumer/src/tree.rs @@ -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!(