fn diff_children(&mut self, old: &'bump [VNode<'bump>], new: &'bump [VNode<'bump>]) {
        // Remember, fragments can never be empty (they always have a single child)
        match (old, new) {
            ([], []) => {}
            ([], _) => self.stack.create_children(new, MountType::Append),
            (_, []) => self.remove_nodes(old, true),
            _ => {
                let new_is_keyed = new[0].key().is_some();
                let old_is_keyed = old[0].key().is_some();

                debug_assert!(
                    new.iter().all(|n| n.key().is_some() == new_is_keyed),
                    "all siblings must be keyed or all siblings must be non-keyed"
                );
                debug_assert!(
                    old.iter().all(|o| o.key().is_some() == old_is_keyed),
                    "all siblings must be keyed or all siblings must be non-keyed"
                );

                if new_is_keyed && old_is_keyed {
                    self.diff_keyed_children(old, new);
                } else {
                    self.diff_non_keyed_children(old, new);
                }
            }
        }
    }
// Diff the given set of old and new children.
//
// The parent must be on top of the change list stack when this function is
// entered:
//
//     [... parent]
//
// the change list stack is in the same state when this function returns.
//
// If old no anchors are provided, then it's assumed that we can freely append to the parent.
//
// Remember, non-empty lists does not mean that there are real elements, just that there are virtual elements.
//
// Fragment nodes cannot generate empty children lists, so we can assume that when a list is empty, it belongs only
// to an element, and appending makes sense.
Diff the given set of old and new children.
The parent must be on top of the change list stack when this function is
entered.



the change list stack is in the same state when this function returns.

If old no anchors are provided, then it's assumed that we can freely append to the parent.

Remember, non-empty lists does not mean that there are real elements, just that there are virtual elements.

Fragment nodes cannot generate empty children lists, so we can assume that when a list is empty, it belongs only
to an element, and appending makes sense.
Diff the given set of old and new children . The parent must be on top of the change list stack when this function is entered . the change list stack is in the same state when this function returns . If old no anchors are provided then it ' s assumed that we can freely append to the parent . Remember non - empty lists does not mean that there are real elements just that there are virtual elements . Fragment nodes cannot generate empty children lists so we can assume that when a list is empty it belongs only to an element and appending makes sense .
fn diff_children(&mut self, old: &'bump [VNode<'bump>], new: &'bump [VNode<'bump>]) {
        // Remember, fragments can never be empty (they always have a single child)
        match (old, new) {
            ([], []) => {}
            ([], _) => self.stack.create_children(new, MountType::Append),
            (_, []) => self.remove_nodes(old, true),
            _ => {
                let new_is_keyed = new[0].key().is_some();
                let old_is_keyed = old[0].key().is_some();
                debug_assert!(
                    new.iter().all(|n| n.key().is_some() == new_is_keyed),
                    "all siblings must be keyed or all siblings must be non-keyed"
                );
                debug_assert!(
                    old.iter().all(|o| o.key().is_some() == old_is_keyed),
                    "all siblings must be keyed or all siblings must be non-keyed"
                );
                if new_is_keyed && old_is_keyed {
                    self.diff_keyed_children(old, new);
                } else {
                    self.diff_non_keyed_children(old, new);
                }
            }
        }
    }
fn diff_children ( & mut self , old : & ' bump [ VNode < ' bump > ] , new : & ' bump [ VNode < ' bump > ] ) { // Remember, fragments can never be empty (they always have a single child) match ( old , new ) { ( [ ] , [ ] ) => { } ( [ ] , _ ) => self . stack . create_children ( new , MountType :: Append ) , ( _ , [ ] ) => self . remove_nodes ( old , true ) , _ => { let new_is_keyed = new [ 0 ] . key ( ) . is_some ( ) ; let old_is_keyed = old [ 0 ] . key ( ) . is_some ( ) ; debug_assert ! ( new iter ( ) all ( n n key ( ) is_some ( ) new_is_keyed ) " " ) ; debug_assert ! ( old iter ( ) all ( o o key ( ) is_some ( ) old_is_keyed ) " " ) ; if new_is_keyed && old_is_keyed { self . diff_keyed_children ( old , new ) ; } else { self . diff_non_keyed_children ( old , new ) ; } } } }
Diff the given set of old and new children.
Diff the given set of old and new children .
&mut self
old
&'bump [VNode<'bump>]
new
&'bump [VNode<'bump>]