Deduplicate undo code
@@ -549,16 +549,11 @@ fn compute_undo(&self, groups: &BTreeSet<usize>) -> (Revision, Subset) {
..
} = rev.edit
{
- if groups.contains(undo_group) {
if !inserts.is_empty() {
- deletes_from_union =
- deletes_from_union.transform_union(inserts);
- }
- } else {
- if !inserts.is_empty() {
- deletes_from_union =
- deletes_from_union.transform_expand(inserts);
+ deletes_from_union = deletes_from_union.transform_union(inserts);
}
+
+ if !groups.contains(undo_group) {
if !deletes.is_empty() {
deletes_from_union = deletes_from_union.union(deletes);
}
