fix: actually remove nodes in keyed_diff_middle

This commit is contained in:
Jonathan Kelley 2022-02-27 14:49:47 -05:00
parent 4954079212
commit 35a3eaabdf

View file

@ -813,6 +813,15 @@ impl<'b> DiffState<'b> {
return;
}
// remove any old children that are not shared
// todo: make this an iterator
for child in old {
let key = child.key().unwrap();
if !shared_keys.contains(&key) {
self.remove_nodes([child], true);
}
}
// 4. Compute the LIS of this list
let mut lis_sequence = Vec::default();
lis_sequence.reserve(new_index_to_old_index.len());