Skip to content

Commit 73fa91f

Browse files
authored
refactor: remove unnecessary check as filter is always non-null (#11599)
1 parent 4e7d5db commit 73fa91f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: packages/runtime-core/src/components/KeepAlive.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,10 @@ const KeepAliveImpl: ComponentOptions = {
195195
_unmount(vnode, instance, parentSuspense, true)
196196
}
197197

198-
function pruneCache(filter?: (name: string) => boolean) {
198+
function pruneCache(filter: (name: string) => boolean) {
199199
cache.forEach((vnode, key) => {
200200
const name = getComponentName(vnode.type as ConcreteComponent)
201-
if (name && (!filter || !filter(name))) {
201+
if (name && !filter(name)) {
202202
pruneCacheEntry(key)
203203
}
204204
})

0 commit comments

Comments
 (0)