From 0e960712c70d63bd0b97646c085a3ab23bf7c93e Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Fri, 11 Jul 2025 08:02:21 -0700 Subject: [PATCH] Flatten condition check. --- src/lib/pool.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lib/pool.ts b/src/lib/pool.ts index d35a91d..ffe1b82 100644 --- a/src/lib/pool.ts +++ b/src/lib/pool.ts @@ -90,11 +90,9 @@ export class Pool { } #assign (thread: Thread, job: Job): void { - if (job.data instanceof ArrayBuffer) { - if (job.data.byteLength > 0) { - thread.job = job - thread.worker.postMessage({ buffer: job.data }, [job.data]) - } + if (job.data instanceof ArrayBuffer && job.data.byteLength > 0) { + thread.job = job + thread.worker.postMessage({ buffer: job.data }, [job.data]) } else { const chunk: number = 1 + (job.data.length / this.threadsIdle) const next = job.data.slice(0, chunk) -- 2.47.3