Skip to content

Commit

Permalink
refactor: remove unnecessary check as filter is always non-null (#11599)
Browse files Browse the repository at this point in the history
  • Loading branch information
edison1105 authored Aug 13, 2024
1 parent 4e7d5db commit 73fa91f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/runtime-core/src/components/KeepAlive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
Expand Down

0 comments on commit 73fa91f

Please sign in to comment.