From e32d28c8abf9c1c856ae8eb9a640ae1bc2518305 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Tue, 3 Dec 2024 12:20:01 -0800 Subject: [PATCH] Ensure worker results are stored only if they exist. --- src/lib/pool.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/pool.ts b/src/lib/pool.ts index b6fcbb0..1baf3ad 100644 --- a/src/lib/pool.ts +++ b/src/lib/pool.ts @@ -62,6 +62,9 @@ export class Pool { #report (thread: Thread, result: any[]): void { thread.isBusy = false + if (result?.length > 0) { + this.#results.push(...result) + } if (this.#approach === 'converge') { this.#stop() } -- 2.34.1