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:
co-authored by
Nathan Sobo
parent
853b636435
commit
e668ff8bcd
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user