Cleanup
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 26 Sep 2022 07:26:15 +0000 (09:26 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 26 Sep 2022 07:26:15 +0000 (09:26 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/pools/selection-strategies.ts

index 034b1612334abe6b83ad1943dd05857e7dad89b7..20e02f31b490530b42771150676ebcd08baeddd8 100644 (file)
@@ -60,7 +60,7 @@ class RoundRobinWorkerChoiceStrategy<Worker extends IWorker, Data, Response>
   public choose (): Worker {
     const chosenWorker = this.pool.workers[this.nextWorkerIndex]
     this.nextWorkerIndex =
-      this.pool.workers.length - 1 === this.nextWorkerIndex
+      this.nextWorkerIndex === this.pool.workers.length - 1
         ? 0
         : this.nextWorkerIndex + 1
     return chosenWorker