refactor: preincrement worker set counter
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 23 Mar 2024 00:19:53 +0000 (01:19 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 23 Mar 2024 00:19:53 +0000 (01:19 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/worker/WorkerSet.ts

index 80f502c2f582d795c37211ce027586e73d29aeb7..4e360db8fa89b8a929cd60fd90a376058b0e2517 100644 (file)
@@ -159,7 +159,7 @@ export class WorkerSet<D extends WorkerData, R extends WorkerData> 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)