From 61d849ff6b50559e44d0d9488cd0573e3cb90c73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 15 Oct 2022 19:47:16 +0200 Subject: [PATCH] Remove uneeded intermediate variable in fair share tasks scheduler MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../fair-share-worker-choice-strategy.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts b/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts index 48f213ff..59dcc3d6 100644 --- a/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts @@ -70,12 +70,11 @@ export class FairShareWorkerChoiceStrategy< Date.now(), this.workerLastVirtualTaskTimestamp.get(worker)?.end ?? -Infinity ) - const workerVirtualTaskEndTimestamp = - workerVirtualTaskStartTimestamp + - (this.pool.getWorkerAverageTasksRunTime(worker) ?? 0) this.workerLastVirtualTaskTimestamp.set(worker, { start: workerVirtualTaskStartTimestamp, - end: workerVirtualTaskEndTimestamp + end: + workerVirtualTaskStartTimestamp + + (this.pool.getWorkerAverageTasksRunTime(worker) ?? 0) }) } } -- 2.34.1