Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/span/src/ast_id.rs')
-rw-r--r--crates/span/src/ast_id.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/span/src/ast_id.rs b/crates/span/src/ast_id.rs
index e54e0bd2fc..3bf14dea75 100644
--- a/crates/span/src/ast_id.rs
+++ b/crates/span/src/ast_id.rs
@@ -603,8 +603,9 @@ impl AstIdMap {
// After all, the block will then contain the *outer* item, so we allocate
// an ID for it anyway.
let mut blocks = Vec::new();
- let mut curr_layer = vec![(node.clone(), None)];
- let mut next_layer = vec![];
+ let mut curr_layer = Vec::with_capacity(32);
+ curr_layer.push((node.clone(), None));
+ let mut next_layer = Vec::with_capacity(32);
while !curr_layer.is_empty() {
curr_layer.drain(..).for_each(|(node, parent_idx)| {
let mut preorder = node.preorder();