refactor: remove unneeded type casting
[poolifier.git] / src / pools / selection-strategies / worker-choice-strategy-context.ts
index cf1b005169d8fbaa04fb074adb4f3f2966cbe335..6f15daa0645174b4ce55008dbd46057a40f9c927 100644 (file)
@@ -48,9 +48,7 @@ export class WorkerChoiceStrategyContext<
   ) {
     this.opts = {
       ...getDefaultInternalWorkerChoiceStrategyOptions(
-        pool.info.maxSize +
-          Object.keys((this.opts?.weights as Record<number, number>) ?? {})
-            .length
+        pool.info.maxSize + Object.keys(this.opts?.weights ?? {}).length
       ),
       ...this.opts
     }
@@ -237,8 +235,7 @@ export class WorkerChoiceStrategyContext<
   ): void {
     this.opts = {
       ...getDefaultInternalWorkerChoiceStrategyOptions(
-        pool.info.maxSize +
-          Object.keys((opts?.weights as Record<number, number>) ?? {}).length
+        pool.info.maxSize + Object.keys(opts?.weights ?? {}).length
       ),
       ...opts
     }