From: Jérôme Benoit Date: Sat, 23 Mar 2024 00:19:53 +0000 (+0100) Subject: refactor: preincrement worker set counter X-Git-Tag: v1.3.1~7 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=2c60ea1e18dbc9667e85fecf1c55462d6eb6e581;p=e-mobility-charging-stations-simulator.git refactor: preincrement worker set counter Signed-off-by: Jérôme Benoit --- diff --git a/src/worker/WorkerSet.ts b/src/worker/WorkerSet.ts index 80f502c2..4e360db8 100644 --- a/src/worker/WorkerSet.ts +++ b/src/worker/WorkerSet.ts @@ -159,7 +159,7 @@ export class WorkerSet extends Worke const { resolve, reject, workerSetElement } = this.promiseResponseMap.get(uuid)! if (event === WorkerMessageEvents.addedWorkerElement) { this.emitter?.emit(WorkerSetEvents.elementAdded, this.info) - workerSetElement.numberOfWorkerElements++ + ++workerSetElement.numberOfWorkerElements resolve(data) } else if (event === WorkerMessageEvents.workerElementError) { this.emitter?.emit(WorkerSetEvents.elementError, data)