refactor: remove unnecessary check as filter is always non-null (#11599)

This commit is contained in:
edison 2024-08-13 22:05:14 +08:00 committed by GitHub
parent 4e7d5db4d2
commit 73fa91fabd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -195,10 +195,10 @@ const KeepAliveImpl: ComponentOptions = {
_unmount(vnode, instance, parentSuspense, true)
}
function pruneCache(filter?: (name: string) => boolean) {
function pruneCache(filter: (name: string) => boolean) {
cache.forEach((vnode, key) => {
const name = getComponentName(vnode.type as ConcreteComponent)
if (name && (!filter || !filter(name))) {
if (name && !filter(name)) {
pruneCacheEntry(key)
}
})