perf: remove unneeded condition check
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 19 Jun 2024 21:17:58 +0000 (23:17 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 19 Jun 2024 21:17:58 +0000 (23:17 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/fixed-priority-queue.ts
src/pools/abstract-pool.ts

index a3de02095fb4fcd34874cea8efbf67c703d01e5c..1cc1480a1b5521d18369cff68a4c2282971f6f85 100644 (file)
@@ -76,8 +76,7 @@ export class FixedPriorityQueue<T> {
       for (let i = 0; i < this.size; i++) {
         if (this.nodeArray[index].priority > priority) {
           this.nodeArray.splice(index, 0, { data, priority })
-          this.nodeArray.length !== this.capacity &&
-            (this.nodeArray.length = this.capacity)
+          this.nodeArray.length = this.capacity
           inserted = true
           break
         }
index 712de0b7da4c38c2808e1be61da7fced8e372da0..f13a25a97aaa1c24d732fc3b41173c5454bc8cff 100644 (file)
@@ -1225,7 +1225,6 @@ export abstract class AbstractPool<
     })
   }
 
-
   /** @inheritDoc */
   public mapExecute (
     data: Iterable<Data>,