perf: remove unneeded condition
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 12 Aug 2023 11:49:06 +0000 (13:49 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 12 Aug 2023 11:49:06 +0000 (13:49 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/pools/abstract-pool.ts

index eb47bc2f24f67b983b4829a763705c6fb8b45828..b48608372574bc5c5af41332e9d85601a8224c95 100644 (file)
@@ -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<Data>): 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<Data>): number {