Skip to content

Commit 00aaa3c

Browse files
committed
remove redundant timer length check
1 parent 7370fcb commit 00aaa3c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/index.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,9 @@ export default class Backburner {
584584

585585
public cancel(timer?) {
586586
cancelCount++;
587-
587+
588588
if (timer === undefined || timer === null) { return false; }
589-
589+
590590
let timerType = typeof timer;
591591
if (timerType === 'number') { // we're cancelling a throttle or debounce
592592
return this._cancelItem(timer, this._throttlers) || this._cancelItem(timer, this._debouncees);
@@ -713,11 +713,9 @@ export default class Backburner {
713713

714714
private _runExpiredTimers() {
715715
this._timerTimeoutId = null;
716-
if (this._timers.length > 0) {
717-
this.begin();
718-
this._scheduleExpiredTimers();
719-
this.end();
720-
}
716+
this.begin();
717+
this._scheduleExpiredTimers();
718+
this.end();
721719
}
722720

723721
private _scheduleExpiredTimers() {

0 commit comments

Comments
 (0)