perf: avoid branching on pool type
[poolifier.git] / src / pools / cluster / dynamic.ts
index 9636b423915fc670c9b42f24680cee131f343c3a..ce28e421544131e2f3b5efbf762e66b1c8b71103 100644 (file)
@@ -38,6 +38,11 @@ export class DynamicClusterPool<
     )
   }
 
+  /** @inheritDoc */
+  protected shallCreateDynamicWorker (): boolean {
+    return !this.full && this.internalBusy()
+  }
+
   /** @inheritDoc */
   protected get type (): PoolType {
     return PoolTypes.dynamic