From: Chris Duncan Date: Tue, 3 Dec 2024 20:51:24 +0000 (-0800) Subject: Explicitly define pool cores. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=174b0388e7d492e7a1926d70d77452b55c399a6e;p=libnemo.git Explicitly define pool cores. --- diff --git a/src/lib/pool.ts b/src/lib/pool.ts index 1baf3ad..d64cd7d 100644 --- a/src/lib/pool.ts +++ b/src/lib/pool.ts @@ -19,7 +19,7 @@ type Thread = { */ export class Pool { #approach: 'converge' | 'divide' = 'divide' - #cores: number = Math.max(1, navigator.hardwareConcurrency ?? 1 - 1) + #cores: number = Math.max(1, (navigator.hardwareConcurrency || 1) - 1) #queue: object[] = [] #resolve: Function = (value: unknown): void => { } #results: object[] = []