From: Jérôme Benoit Date: Sat, 12 Aug 2023 11:49:06 +0000 (+0200) Subject: perf: remove unneeded condition X-Git-Tag: v2.6.24~8 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=bbfa38a20c501deeb93723d5ac3527bb47e30ae8;p=poolifier.git perf: remove unneeded condition Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index eb47bc2f..b4860837 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -28,13 +28,12 @@ import { PoolTypes, type TasksQueueOptions } from './pool' -import { - type IWorker, - type IWorkerNode, - type WorkerInfo, - type WorkerType, - WorkerTypes, - type WorkerUsage +import type { + IWorker, + IWorkerNode, + WorkerInfo, + WorkerType, + WorkerUsage } from './worker' import { type MeasurementStatisticsRequirements, @@ -1171,13 +1170,7 @@ export abstract class AbstractPool< */ private executeTask (workerNodeKey: number, task: Task): void { this.beforeTaskExecutionHook(workerNodeKey, task) - this.sendToWorker( - workerNodeKey, - task, - this.worker === WorkerTypes.thread && task.transferList != null - ? task.transferList - : undefined - ) + this.sendToWorker(workerNodeKey, task, task.transferList) } private enqueueTask (workerNodeKey: number, task: Task): number {