Skip to content

Commit 60aab81

Browse files
author
xiajianshe
committed
最长递增子序列算法
1 parent 030e93b commit 60aab81

File tree

3 files changed

+76
-2
lines changed

3 files changed

+76
-2
lines changed

packages/runtime-core/src/renderer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ export function createRenderer(
192192
let anchor = index + 1 < c2.length ? c2[index + 1].el : null
193193

194194
if (newIndexToOldIndex[i] === 0) {
195+
// 创建 [5 3 4 0] => [1,2] 最长递增子序列,因为不是发现有一些不需要更新,只要移动位置就行
195196
// 创建
196197
patch(null, current, el, anchor)
197198
} else {

0 commit comments

Comments
 (0)