mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-06 02:37:21 +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,
|
was_dirty: bool,
|
||||||
cx: &mut ModelContext<Self>,
|
cx: &mut ModelContext<Self>,
|
||||||
) {
|
) {
|
||||||
let patch = Patch::new(self.edits_since::<usize>(old_version).collect());
|
if self.edits_since::<usize>(old_version).next().is_none() {
|
||||||
if patch.is_empty() {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue