checking to make sure children is not empty before applying replace opt

This commit is contained in:
Jose Quesada 2022-11-28 14:19:31 -06:00
parent 04aa1585fa
commit af067361a9

View file

@ -392,7 +392,7 @@ fn apply_cmds<T, EF, N>(
let mut items_to_move = Vec::with_capacity(cmds.moving);
// We can optimize the case of replacing all items
if cmds.removing == children.len() {
if !children.is_empty() && cmds.removing == children.len() {
children.clear();
#[cfg(all(target_arch = "wasm32", feature = "web"))]