From 0d50c74caba639fd1ad442a0098f86224ea946e8 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 14 May 2021 16:07:46 +0200 Subject: [PATCH] :lipstick: --- zed/src/editor/buffer/rope.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/zed/src/editor/buffer/rope.rs b/zed/src/editor/buffer/rope.rs index bc1d672658c40252f5649b0f27a0958c9ce9c951..4bd2297c39272930e4fb556e15c167e7e238ea53 100644 --- a/zed/src/editor/buffer/rope.rs +++ b/zed/src/editor/buffer/rope.rs @@ -24,14 +24,9 @@ impl Rope { pub fn append(&mut self, rope: Rope) { let mut chunks = rope.chunks.cursor::<(), ()>(); chunks.next(); - - while let Some((last_chunk, first_chunk)) = self.chunks.last().zip(chunks.item()) { - if last_chunk.0.len() < CHUNK_BASE || first_chunk.0.len() < CHUNK_BASE { - self.push(&first_chunk.0); - chunks.next(); - } else { - break; - } + if let Some(chunk) = chunks.item() { + self.push(&chunk.0); + chunks.next(); } self.chunks.push_tree(chunks.suffix(&()), &());