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