From 81696bd5662abd04013423cbe9427d2643c7ae25 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 2 May 2021 18:33:35 +0200 Subject: [PATCH] Check for threadId worker attribute only MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/utils/Utils.ts | 2 +- src/worker/WorkerSet.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 25ac7634..b975d0a4 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -130,7 +130,7 @@ export default class Utils { return JSON.parse(JSON.stringify(object)) as T; } - static isIterable(obj): boolean { + static isIterable(obj: T): boolean { if (obj) { return typeof obj[Symbol.iterator] === 'function'; } diff --git a/src/worker/WorkerSet.ts b/src/worker/WorkerSet.ts index 0e6855f1..dd12fdb5 100644 --- a/src/worker/WorkerSet.ts +++ b/src/worker/WorkerSet.ts @@ -98,7 +98,7 @@ export default class WorkerSet extends WorkerAbstract { private getWorkerSetElementByWorker(worker: Worker): WorkerSetElement { let workerSetElt: WorkerSetElement; this.workerSet.forEach((workerSetElement) => { - if (JSON.stringify(workerSetElement.worker) === JSON.stringify(worker)) { + if (workerSetElement.worker.threadId === worker.threadId) { workerSetElt = workerSetElement; } }); -- 2.34.1