mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-26 03:59:55 +00:00
Avoid allocating a Patch
just to check if there are no edits
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
853b636435
commit
e668ff8bcd
1 changed files with 1 additions and 2 deletions
|
@ -1326,8 +1326,7 @@ impl Buffer {
|
|||
was_dirty: bool,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) {
|
||||
let patch = Patch::new(self.edits_since::<usize>(old_version).collect());
|
||||
if patch.is_empty() {
|
||||
if self.edits_since::<usize>(old_version).next().is_none() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue