multi_buffer: Pre-allocate IDs when editing (#36819)
Something I came across when looking at `edit_internal`. Potentially saves multiple re-allocations on an edit Release Notes: - N/A
This commit is contained in:
parent
de5f87e8f2
commit
dd6fce6d4e
1 changed files with 1 additions and 1 deletions
|
@ -835,7 +835,7 @@ impl MultiBuffer {
|
|||
this.convert_edits_to_buffer_edits(edits, &snapshot, &original_indent_columns);
|
||||
drop(snapshot);
|
||||
|
||||
let mut buffer_ids = Vec::new();
|
||||
let mut buffer_ids = Vec::with_capacity(buffer_edits.len());
|
||||
for (buffer_id, mut edits) in buffer_edits {
|
||||
buffer_ids.push(buffer_id);
|
||||
edits.sort_by_key(|edit| edit.range.start);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue