Skip to content

Commit

Permalink
preallocate new children array (#4595)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock authored Dec 6, 2024
1 parent 2d76a3b commit b864138
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/diff/children.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b864138

Please sign in to comment.