From: Jérôme Benoit Date: Sat, 26 Aug 2023 23:36:47 +0000 (+0200) Subject: perf: remove unneeded condition in tasks stealing code X-Git-Tag: v2.6.37~41 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=8b80810a81554f0e6442dd681e68f59fdfd23312;p=poolifier.git perf: remove unneeded condition in tasks stealing code Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index f862bbbe..2f5c6189 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1302,11 +1302,7 @@ export abstract class AbstractPool< ...(sourceWorkerNode.popTask() as Task), workerId: workerNode.info.id as number } - if ( - this.tasksQueueSize(workerNodeKey) === 0 && - workerNode.usage.tasks.executing < - (this.opts.tasksQueueOptions?.concurrency as number) - ) { + if (this.tasksQueueSize(workerNodeKey) === 0) { this.executeTask(workerNodeKey, task) } else { this.enqueueTask(workerNodeKey, task)