diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs index cc8ec8d0..e16c2b6d 100644 --- a/helix-core/src/selection.rs +++ b/helix-core/src/selection.rs @@ -214,7 +214,7 @@ impl Selection { ranges.sort_unstable_by_key(Range::from); primary_index = ranges.iter().position(|&range| range == primary).unwrap(); - let mut result = SmallVec::new(); + let mut result = SmallVec::with_capacity(ranges.len()); // approx // TODO: we could do with one vec by removing elements as we mutate