]> zoso.dev Git - libnemo.git/commitdiff
Explicitly define pool cores.
authorChris Duncan <chris@zoso.dev>
Tue, 3 Dec 2024 20:51:24 +0000 (12:51 -0800)
committerChris Duncan <chris@zoso.dev>
Tue, 3 Dec 2024 20:51:24 +0000 (12:51 -0800)
src/lib/pool.ts

index 1baf3adef23f0eca9a82f618fc5c2b285ca884d9..d64cd7d9b5c37e105fa8ab5e4b20198adb414a89 100644 (file)
@@ -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[] = []