refactor: code cleanup
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 16 Sep 2023 21:53:05 +0000 (23:53 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 16 Sep 2023 21:53:05 +0000 (23:53 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/abstract-pool.ts

index d3540098d4ca192ed0e93b6a491358435572c743..9aa6ec3dfeab90f8ba462920290f8a7b74b91f80 100644 (file)
@@ -699,14 +699,13 @@ export abstract class AbstractPool<
               (this.opts.tasksQueueOptions?.concurrency as number)
         ) === -1
       )
-    } else {
-      return (
-        this.workerNodes.findIndex(
-          workerNode =>
-            workerNode.info.ready && workerNode.usage.tasks.executing === 0
-        ) === -1
-      )
     }
+    return (
+      this.workerNodes.findIndex(
+        workerNode =>
+          workerNode.info.ready && workerNode.usage.tasks.executing === 0
+      ) === -1
+    )
   }
 
   /** @inheritDoc */