mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 21:13:02 +00:00
Save an allocation when editing locally
This commit is contained in:
parent
e071d40058
commit
125be2f07a
1 changed files with 2 additions and 2 deletions
|
@ -1445,8 +1445,7 @@ impl Buffer {
|
|||
id: local_timestamp,
|
||||
version: self.version(),
|
||||
ranges: Vec::with_capacity(ranges.len()),
|
||||
// TODO: avoid cloning here
|
||||
new_text: new_text.clone(),
|
||||
new_text: None,
|
||||
};
|
||||
|
||||
let mut new_ropes =
|
||||
|
@ -1555,6 +1554,7 @@ impl Buffer {
|
|||
self.fragments = new_fragments;
|
||||
self.visible_text = visible_text;
|
||||
self.deleted_text = deleted_text;
|
||||
edit.new_text = new_text;
|
||||
edit
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue