X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fselection-strategies-utils.ts;h=d1e60e0350839893631a9e153ef143521ca2f6b3;hb=f7a08a34fc67a4c4406798c85f1ad669a7d53223;hp=bed0d624ec4c6d5856baab6b42653f2c521f6093;hpb=3e931141fe4cbbb1221697a1ee4fd26f4c419c82;p=poolifier.git diff --git a/src/pools/selection-strategies/selection-strategies-utils.ts b/src/pools/selection-strategies/selection-strategies-utils.ts index bed0d624..d1e60e03 100644 --- a/src/pools/selection-strategies/selection-strategies-utils.ts +++ b/src/pools/selection-strategies/selection-strategies-utils.ts @@ -17,10 +17,6 @@ import { import { WeightedRoundRobinWorkerChoiceStrategy } from './weighted-round-robin-worker-choice-strategy.js' import type { WorkerChoiceStrategiesContext } from './worker-choice-strategies-context.js' -const clone = (object: T): T => { - return structuredClone(object) -} - const estimatedCpuSpeed = (): number => { const runs = 150000000 const begin = performance.now() @@ -90,7 +86,7 @@ export const buildWorkerChoiceStrategyOptions = < pool: IPool, opts?: WorkerChoiceStrategyOptions ): WorkerChoiceStrategyOptions => { - opts = clone(opts ?? {}) + opts = structuredClone(opts ?? {}) opts.weights = opts.weights ?? getDefaultWeights(pool.info.maxSize) return { ...{