refactor(ci): cleanup GH actions
[poolifier.git] / src / fixed-priority-queue.ts
index efcc35ca67c23d89e8c5eed82c50125e3353a4d7..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
         }
@@ -175,11 +174,13 @@ export class FixedPriorityQueue<T> {
   private checkSize (size: number): void {
     if (!Number.isSafeInteger(size)) {
       throw new TypeError(
-        `Invalid fixed priority queue size: '${size}' is not an integer`
+        `Invalid fixed priority queue size: '${size.toString()}' is not an integer`
       )
     }
     if (size < 0) {
-      throw new RangeError(`Invalid fixed priority queue size: ${size} < 0`)
+      throw new RangeError(
+        `Invalid fixed priority queue size: ${size.toString()} < 0`
+      )
     }
   }
 }