Skip to content

Commit 48b79d0

Browse files
pikaxyyx990803
authored andcommitted
perf(runtime-core): use faster diff map population (vuejs#319)
1 parent 6a75c34 commit 48b79d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/runtime-core/src/createRenderer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,8 +1502,8 @@ export function createRenderer<
15021502
// and oldIndex = 0 is a special value indicating the new node has
15031503
// no corresponding old node.
15041504
// used for determining longest stable subsequence
1505-
const newIndexToOldIndexMap = []
1506-
for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap.push(0)
1505+
const newIndexToOldIndexMap = new Array(toBePatched)
1506+
for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0
15071507

15081508
for (i = s1; i <= e1; i++) {
15091509
const prevChild = c1[i]

0 commit comments

Comments
 (0)