X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fselection-strategies-utils.ts;fp=src%2Fpools%2Fselection-strategies%2Fselection-strategies-utils.ts;h=d1e60e0350839893631a9e153ef143521ca2f6b3;hb=85bbc7ab16c9f69a5dd358b71e3e6d4204dfd630;hp=bed0d624ec4c6d5856baab6b42653f2c521f6093;hpb=915040cce0e378cc1e806391bf77af06880c12f2;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 { ...{