refactor(scheduler): simplify checkRecursiveUpdates (#11856)
This commit is contained in:
parent
f80d447c17
commit
48613bb928
|
@ -267,10 +267,7 @@ function flushJobs(seen?: CountMap) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkRecursiveUpdates(seen: CountMap, fn: SchedulerJob) {
|
function checkRecursiveUpdates(seen: CountMap, fn: SchedulerJob) {
|
||||||
if (!seen.has(fn)) {
|
const count = seen.get(fn) || 0
|
||||||
seen.set(fn, 1)
|
|
||||||
} else {
|
|
||||||
const count = seen.get(fn)!
|
|
||||||
if (count > RECURSION_LIMIT) {
|
if (count > RECURSION_LIMIT) {
|
||||||
const instance = fn.i
|
const instance = fn.i
|
||||||
const componentName = instance && getComponentName(instance.type)
|
const componentName = instance && getComponentName(instance.type)
|
||||||
|
@ -286,8 +283,7 @@ function checkRecursiveUpdates(seen: CountMap, fn: SchedulerJob) {
|
||||||
ErrorCodes.APP_ERROR_HANDLER,
|
ErrorCodes.APP_ERROR_HANDLER,
|
||||||
)
|
)
|
||||||
return true
|
return true
|
||||||
} else {
|
}
|
||||||
seen.set(fn, count + 1)
|
seen.set(fn, count + 1)
|
||||||
}
|
return false
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue