Sort deletes first

This commit is contained in:
Andras Schmelczer 2025-06-21 13:18:13 +01:00
parent 5afb2c21f8
commit 7589e1bf2e
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
2 changed files with 11 additions and 11 deletions

View file

@ -41,20 +41,20 @@ where
}
},
RawOperation::Equal(..) => Box::new(
maybe_previous_insert
maybe_previous_delete
.take()
.into_iter()
.chain(maybe_previous_delete.take())
.chain(maybe_previous_insert.take())
.chain(iter::once(next)),
) as Box<dyn Iterator<Item = RawOperation<T>>>,
})
.collect();
if let Some(prev) = maybe_previous_insert {
if let Some(prev) = maybe_previous_delete {
result.push(prev);
}
if let Some(prev) = maybe_previous_delete {
if let Some(prev) = maybe_previous_insert {
result.push(prev);
}