From 53cf34054602ef192d39c45ef257eddc0ae0fa97 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 6 Apr 2023 08:53:39 +0200 Subject: [PATCH] perf: remove unneeded nullish checks in hot code paths MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../selection-strategies/less-used-worker-choice-strategy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pools/selection-strategies/less-used-worker-choice-strategy.ts b/src/pools/selection-strategies/less-used-worker-choice-strategy.ts index 01332caf..dffed99e 100644 --- a/src/pools/selection-strategies/less-used-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/less-used-worker-choice-strategy.ts @@ -31,7 +31,7 @@ export class LessUsedWorkerChoiceStrategy< let lessUsedWorkerKey!: number for (const [index, workerItem] of this.pool.workers.entries()) { const tasksUsage = workerItem.tasksUsage - const workerTasks = tasksUsage?.run + tasksUsage?.running + const workerTasks = tasksUsage.run + tasksUsage.running if (workerTasks === 0) { return index } else if (workerTasks < minNumberOfTasks) { -- 2.34.1