From b864138b6c4f8400f5984e1c7afcfe18c4c44fbf Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Fri, 6 Dec 2024 14:44:44 +0100 Subject: [PATCH] preallocate new children array (#4595) --- src/diff/children.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diff/children.js b/src/diff/children.js index 6f5059751e..68b8f27f89 100644 --- a/src/diff/children.js +++ b/src/diff/children.js @@ -166,7 +166,7 @@ function constructNewChildrenArray( let skew = 0; - newParentVNode._children = []; + newParentVNode._children = new Array(newChildrenLength); for (i = 0; i < newChildrenLength; i++) { // @ts-expect-error We are reusing the childVNode variable to hold both the // pre and post normalized childVNode