on master help sign in
Provide a capacity on Selection::new's normalize.
bd607b4Blaž Hrastnik
helix-core/src/selection.rs+1−1
@@ -214,7 +214,7 @@ impl Selection {
214 ranges.sort_unstable_by_key(Range::from);
214 ranges.sort_unstable_by_key(Range::from);
215 primary_index = ranges.iter().position(|&range| range == primary).unwrap();
215 primary_index = ranges.iter().position(|&range| range == primary).unwrap();
216
216
217− let mut result = SmallVec::new();
217+ let mut result = SmallVec::with_capacity(ranges.len()); // approx
218
218
219 // TODO: we could do with one vec by removing elements as we mutate
219 // TODO: we could do with one vec by removing elements as we mutate
220
220