mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 13:24:19 +00:00
💄
This commit is contained in:
parent
9f9f339a75
commit
0d50c74cab
1 changed files with 3 additions and 8 deletions
|
@ -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(&()), &());
|
||||
|
|
Loading…
Reference in a new issue