diff options
author | Blaž Hrastnik | 2021-11-06 14:57:42 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-11-06 14:57:42 +0000 |
commit | f979bdc442ab3150a369ff8bee0703e90e32e2a4 (patch) | |
tree | cdf5e4ebb5473605ab9575dc4fc4d0122049d1d1 | |
parent | 2c1313c0648977540c395de584b4293c1909cbf7 (diff) |
Specify capacity on toggle_line_comments
-rw-r--r-- | helix-core/src/comment.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-core/src/comment.rs b/helix-core/src/comment.rs index 4072a532..b22a95a6 100644 --- a/helix-core/src/comment.rs +++ b/helix-core/src/comment.rs @@ -63,7 +63,7 @@ pub fn toggle_line_comments(doc: &Rope, selection: &Selection, token: Option<&st let token = token.unwrap_or("//"); let comment = Tendril::from(format!("{} ", token)); - let mut lines: Vec<usize> = Vec::new(); + let mut lines: Vec<usize> = Vec::with_capacity(selection.len()); let mut min_next_line = 0; for selection in selection { |