From 82ff5b0ab6fd620a23744ffa514ce7a82900ca02 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Sat, 6 Nov 2021 23:57:42 +0900 Subject: Specify capacity on toggle_line_comments --- helix-core/src/comment.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'helix-core/src') 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 = Vec::new(); + let mut lines: Vec = Vec::with_capacity(selection.len()); let mut min_next_line = 0; for selection in selection { -- cgit v1.2.3-70-g09d2