I don't quite understand this case. It looks like we're saying: if the current nodes in the two child lists don't match, but both of them exist in both trees, then just keep moving without generating any edits. It seems like we should actually generate both edits (the delete of the old node and the insertion of the new node), and then make sure that the final edit list is ordered so that the re-insertion of the old node (which by definition must happen at some point, because it's still in the new map) happens after its deletion, and vice versa for the new node. (But the complication there is that reordering edits is dangerous because the before/afterID pointers might get messed up...)