refactor: cleanup null test
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 16 Dec 2023 16:58:21 +0000 (17:58 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 16 Dec 2023 16:58:21 +0000 (17:58 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/worker/WorkerSet.ts

index 17b5b6dde201c85f4c0af0cbaf3574d33968fb03..047d03ad0ee09aa9922e4b66667f34ddc7f5b8e6 100644 (file)
@@ -30,10 +30,7 @@ export class WorkerSet extends WorkerAbstract<WorkerData> {
    */
   constructor(workerScript: string, workerOptions: WorkerOptions) {
     super(workerScript, workerOptions);
-    if (
-      this.workerOptions.elementsPerWorker === null ||
-      this.workerOptions.elementsPerWorker === undefined
-    ) {
+    if (this.workerOptions.elementsPerWorker == null) {
       throw new TypeError('Elements per worker is not defined');
     }
     if (!Number.isSafeInteger(this.workerOptions.elementsPerWorker)) {