perf: optimize a pool type test
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 5 Apr 2023 12:03:41 +0000 (14:03 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 5 Apr 2023 12:03:41 +0000 (14:03 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/pools/selection-strategies/worker-choice-strategy-context.ts

index 3d122f0292d77805a3e59fb56a386fbec1b54396..8041e2f6577b7ca046c6e51048ed2a7d873923db 100644 (file)
@@ -1,5 +1,4 @@
 import type { IPoolInternal } from '../pool-internal'
-import { PoolType } from '../pool-internal'
 import type { IPoolWorker } from '../pool-worker'
 import type {
   IWorkerChoiceStrategy,
@@ -70,7 +69,7 @@ export class WorkerChoiceStrategyContext<
    */
   public execute (): number {
     if (
-      this.pool.type === PoolType.DYNAMIC &&
+      this.workerChoiceStrategy.isDynamicPool &&
       !this.pool.full &&
       this.pool.findFreeWorkerKey() === -1
     ) {