From 2c60ea1e18dbc9667e85fecf1c55462d6eb6e581 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 23 Mar 2024 01:19:53 +0100 Subject: [PATCH] refactor: preincrement worker set counter MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/worker/WorkerSet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.34.1