Skip to content

Commit 1f2926a

Browse files
authored
perf: optimize LRU access in keep-alive (#1316)
1 parent 0b93440 commit 1f2926a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/runtime-core/src/components/KeepAlive.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ const KeepAliveImpl = {
226226
keys.add(key)
227227
// prune oldest entry
228228
if (max && keys.size > parseInt(max as string, 10)) {
229-
pruneCacheEntry(Array.from(keys)[0])
229+
pruneCacheEntry(keys.values().next().value)
230230
}
231231
}
232232
// avoid vnode being unmounted

0 commit comments

Comments
 (0)