From: Jérôme Benoit Date: Tue, 26 Dec 2023 18:42:54 +0000 (+0100) Subject: refactor: cleanup conditions X-Git-Tag: v3.1.12-0~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=0d03353828857a8d0eb17b318fd817ffb873fc40;p=poolifier.git refactor: cleanup conditions Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index b72d8cbc..7b18d355 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1420,10 +1420,7 @@ export abstract class AbstractPool< } private redistributeQueuedTasks (workerNodeKey: number): void { - if (workerNodeKey === -1) { - return - } - if (this.cannotStealTask()) { + if (workerNodeKey === -1 || this.cannotStealTask()) { return } while (this.tasksQueueSize(workerNodeKey) > 0) {