aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-22 05:50:08 +0000
committerBlaž Hrastnik2021-03-22 05:50:08 +0000
commitbd607b4cbd58e2bff06e36f614ff61b7d1a721c3 (patch)
tree62989bd44179ed7f83a3d0f75672497359ffaeb6 /helix-core/src
parentdf306fe031e6ddb188cda9d33da019b65af8cd99 (diff)
Provide a capacity on Selection::new's normalize.
Diffstat (limited to 'helix-core/src')
-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