perf: optimize LRU access in keep-alive (#1316)

This commit is contained in:
ysj16
2020-06-12 05:24:50 +08:00
committed by GitHub
parent 0b93440146
commit 1f2926a33c

View File

@@ -226,7 +226,7 @@ const KeepAliveImpl = {
keys.add(key) keys.add(key)
// prune oldest entry // prune oldest entry
if (max && keys.size > parseInt(max as string, 10)) { if (max && keys.size > parseInt(max as string, 10)) {
pruneCacheEntry(Array.from(keys)[0]) pruneCacheEntry(keys.values().next().value)
} }
} }
// avoid vnode being unmounted // avoid vnode being unmounted