From: Jérôme Benoit Date: Sat, 5 Jul 2025 17:49:36 +0000 (+0200) Subject: perf: remove unneeded null check at building abortable task function X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=0961d2de5e99f1c9ea11db7d317bdf6ca9ef2af1;p=poolifier.git perf: remove unneeded null check at building abortable task function Signed-off-by: Jérôme Benoit --- diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index 0bcc8757d..f3c36bceb 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -677,7 +677,8 @@ export abstract class AbstractWorker< this.taskAbortFunctions.set(taskId, () => { reject(new AbortError(`Task '${name}' id '${taskId}' aborted`)) }) - const taskFunction = this.taskFunctions.get(name)?.taskFunction + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const taskFunction = this.taskFunctions.get(name)!.taskFunction if (isAsyncFunction(taskFunction)) { ;(taskFunction as TaskAsyncFunction)(data) .then(resolve)