mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-29 08:32:27 +03:00
Avoid creating redundant snapshots of channel notes buffers
Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
parent
358a20494c
commit
c7c220309d
@ -326,9 +326,11 @@ impl Database {
|
||||
.ok_or_else(|| anyhow!("no such buffer"))?;
|
||||
|
||||
let (base_text, operations) = self.get_buffer_state(&buffer, tx).await?;
|
||||
if operations.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let mut text_buffer = text::Buffer::new(0, 0, base_text);
|
||||
|
||||
text_buffer
|
||||
.apply_ops(operations.into_iter().filter_map(operation_from_wire))
|
||||
.unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user