diff options
author | Blaž Hrastnik | 2021-03-22 05:50:08 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-03-22 05:50:08 +0000 |
commit | bd607b4cbd58e2bff06e36f614ff61b7d1a721c3 (patch) | |
tree | 62989bd44179ed7f83a3d0f75672497359ffaeb6 /helix-core | |
parent | df306fe031e6ddb188cda9d33da019b65af8cd99 (diff) |
Provide a capacity on Selection::new's normalize.
Diffstat (limited to 'helix-core')
-rw-r--r-- | helix-core/src/selection.rs | 2 |
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 |