refactor: remove unneeded intermediate variable
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 2 Apr 2023 15:52:35 +0000 (17:52 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 2 Apr 2023 15:52:35 +0000 (17:52 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/pools/abstract-pool.ts

index 2c4559a34dd1f5079f7ce7d0e8efaf70b979372e..947db17c8480ea97de0591c280042081c0ba4935 100644 (file)
@@ -411,8 +411,7 @@ export abstract class AbstractPool<
   public getWorkerTasksUsage (worker: Worker): TasksUsage | undefined {
     const workerKey = this.getWorkerKey(worker)
     if (workerKey !== undefined) {
-      const workerEntry = this.workers.get(workerKey) as WorkerType<Worker>
-      return workerEntry.tasksUsage
+      return (this.workers.get(workerKey) as WorkerType<Worker>).tasksUsage
     }
     throw new Error('Worker could not be found in the pool')
   }