@@ -793,9 +793,13 @@ fn diff_non_keyed_children(
794 for (i, (new_child, old_child)) in new.iter().zip(old.iter()).enumerate() {
794 for (i, (new_child, old_child)) in new.iter().zip(old.iter()).enumerate() {
795 if i == 0 {
795 if i == 0 {
796 change_list.push_first_child();
797 change_list.push_first_child();
798+ // [... parent first_child]
800+ // [... parent prev_sibling]
798 change_list.pop_push_next_sibling();
801 change_list.pop_push_next_sibling();
802+ // [... parent next_sibling]
@@ -808,13 +812,23 @@ fn diff_non_keyed_children(
815+ // Note that because `new` and `old` are not empty, the previous loop always
816+ // executes at least once, so the change list stack is now:
818+ // [... parent child]
811 match old.len().cmp(&new.len()) {
820 match old.len().cmp(&new.len()) {
812 Ordering::Greater => {
821 Ordering::Greater => {
822+ // [... parent last_shared_child]
813 change_list.pop_push_next_sibling();
823 change_list.pop_push_next_sibling();
824+ // [... parent first_child_to_remove]
814 remove_self_and_next_siblings(change_list, registry, &old[new.len()..]);
825 remove_self_and_next_siblings(change_list, registry, &old[new.len()..]);
816 Ordering::Less => {
828 Ordering::Less => {
829+ // [... parent last_child]
817 change_list.pop();
830 change_list.pop();
818 create_and_append_children(
832 create_and_append_children(
819 cached_set,
833 cached_set,
820 change_list,
834 change_list,
@@ -824,7 +838,9 @@ fn diff_non_keyed_children(
826 Ordering::Equal => {
840 Ordering::Equal => {
841+ // [... parent child]
827 change_list.pop();
842 change_list.pop();