From 402b174842861d1edabb05e42f45d9826a582a89 Mon Sep 17 00:00:00 2001 From: Zixuan Chen Date: Wed, 16 Nov 2022 17:24:58 +0800 Subject: [PATCH] perf: avoid heap alloc --- crates/rle/src/rle_tree/node/leaf_impl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/rle/src/rle_tree/node/leaf_impl.rs b/crates/rle/src/rle_tree/node/leaf_impl.rs index 31acccce..d90fa0c8 100644 --- a/crates/rle/src/rle_tree/node/leaf_impl.rs +++ b/crates/rle/src/rle_tree/node/leaf_impl.rs @@ -481,7 +481,7 @@ impl<'bump, T: Rle, A: RleTreeTrait> LeafNode<'bump, T, A> { } } - let mut new_children: Vec<_> = Vec::new(); + let mut new_children: SmallVec<[_; 64]> = SmallVec::new(); let mut self_children = std::mem::replace( &mut self.children, <::Vec<'bump, _> as VecTrait<_>>::with_capacity_in(