refactor: cleanup conditions
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 26 Dec 2023 18:42:54 +0000 (19:42 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 26 Dec 2023 18:42:54 +0000 (19:42 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/abstract-pool.ts

index b72d8cbcb4c3354294dda16718a6d229e64d04e0..7b18d3556c72e6aee4629ae9831452325ea9d087 100644 (file)
@@ -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) {