on master help sign in
Provide a capacity on Selection::new's normalize.
commitbd607b4cbd58e2bff06e36f614ff61b7d1a721c3 authorBlaž Hrastnik <blaz@mxxn.io> dateMon 22 Mar 2021, 14:50 (6 years ago) parentdf306fe
1 file changed+1−1
helix-core/src/selection.rs+1−1
helix-core/src/selection.rs+1−1
@@ -214,7 +214,7 @@ impl Selection {
214214 ranges.sort_unstable_by_key(Range::from);
215215 primary_index = ranges.iter().position(|&range| range == primary).unwrap();
216216
217− let mut result = SmallVec::new();
217+ let mut result = SmallVec::with_capacity(ranges.len()); // approx
218218
219219 // TODO: we could do with one vec by removing elements as we mutate
220220