]> zoso.dev Git - libnemo.git/commitdiff
Ensure worker results are stored only if they exist.
authorChris Duncan <chris@zoso.dev>
Tue, 3 Dec 2024 20:20:01 +0000 (12:20 -0800)
committerChris Duncan <chris@zoso.dev>
Tue, 3 Dec 2024 20:20:01 +0000 (12:20 -0800)
src/lib/pool.ts

index b6fcbb0cea164e89fe7be0aaa8476e505b2d319f..1baf3adef23f0eca9a82f618fc5c2b285ca884d9 100644 (file)
@@ -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()
                }