Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Avoid creating redundant snapshots of channel notes buffers

Max Brunsfeldc7c220309dbf
diff --git a/crates/collab/src/db/queries/buffers.rs b/crates/collab/src/db/queries/buffers.rs
index a38693bace2..354accc01a2 100644
--- a/crates/collab/src/db/queries/buffers.rs
+++ b/crates/collab/src/db/queries/buffers.rs
@@ -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();