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.

Remove unnecessary clone from `Rope::append` (#39960)

Martin Pool3d4d8ef6a8d0
diff --git a/crates/rope/src/rope.rs b/crates/rope/src/rope.rs
index 508e7569c3b..c349f3f4513 100644
--- a/crates/rope/src/rope.rs
+++ b/crates/rope/src/rope.rs
@@ -114,11 +114,9 @@ impl Rope {
chunks.next();
chunks.next();
self.chunks.append(chunks.suffix(), ());
- self.check_invariants();
- return;
+ } else {
+ self.chunks.append(rope.chunks, ());
}
-
- self.chunks.append(rope.chunks.clone(), ());
self.check_invariants();
}