Skip to content

Commit

Permalink
perf: optimize LRU access in keep-alive (#1316)
Browse files Browse the repository at this point in the history
  • Loading branch information
ysj16 authored Jun 11, 2020
1 parent 0b93440 commit 1f2926a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/runtime-core/src/components/KeepAlive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ const KeepAliveImpl = {
keys.add(key)
// prune oldest entry
if (max && keys.size > parseInt(max as string, 10)) {
pruneCacheEntry(Array.from(keys)[0])
pruneCacheEntry(keys.values().next().value)
}
}
// avoid vnode being unmounted
Expand Down

0 comments on commit 1f2926a

Please sign in to comment.