From: Jérôme Benoit Date: Sat, 15 Oct 2022 17:47:16 +0000 (+0200) Subject: Remove uneeded intermediate variable in fair share tasks scheduler X-Git-Tag: v2.3.4~14 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=61d849ff6b50559e44d0d9488cd0573e3cb90c73;p=poolifier.git Remove uneeded intermediate variable in fair share tasks scheduler Signed-off-by: Jérôme Benoit --- 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) }) } }