aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-11-06 14:57:42 +0000
committerBlaž Hrastnik2021-11-08 01:03:21 +0000
commit82ff5b0ab6fd620a23744ffa514ce7a82900ca02 (patch)
tree7bee2f4f45b782cd253d8a34bfaef07cd9017745 /helix-core/src
parent4010b327e2dbb96dc0ac2a5ae41913486c577bec (diff)
Specify capacity on toggle_line_comments
Diffstat (limited to 'helix-core/src')
-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 {