summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--helix-core/src/selection.rs2
1 files changed, 1 insertions, 1 deletions
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