perf: optimize a pool type test
[poolifier.git] / 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
     ) {