Skip to content

Commit b864138

Browse files
authored
preallocate new children array (#4595)
1 parent 2d76a3b commit b864138

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/diff/children.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function constructNewChildrenArray(
166166

167167
let skew = 0;
168168

169-
newParentVNode._children = [];
169+
newParentVNode._children = new Array(newChildrenLength);
170170
for (i = 0; i < newChildrenLength; i++) {
171171
// @ts-expect-error We are reusing the childVNode variable to hold both the
172172
// pre and post normalized childVNode

0 commit comments

Comments
 (0)