summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-11-06 14:57:42 +0000
committerBlaž Hrastnik2021-11-06 14:57:42 +0000
commitf979bdc442ab3150a369ff8bee0703e90e32e2a4 (patch)
treecdf5e4ebb5473605ab9575dc4fc4d0122049d1d1
parent2c1313c0648977540c395de584b4293c1909cbf7 (diff)
Specify capacity on toggle_line_comments
-rw-r--r--helix-core/src/comment.rs2
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 {