X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ffixed-priority-queue.ts;h=1cc1480a1b5521d18369cff68a4c2282971f6f85;hb=1352ca70c0b5c6b4ff3813b0c24354b5514b2796;hp=efcc35ca67c23d89e8c5eed82c50125e3353a4d7;hpb=3a5027122ca6401ae1d755843b20f714c61e3240;p=poolifier.git diff --git a/src/fixed-priority-queue.ts b/src/fixed-priority-queue.ts index efcc35ca..1cc1480a 100644 --- a/src/fixed-priority-queue.ts +++ b/src/fixed-priority-queue.ts @@ -76,8 +76,7 @@ export class FixedPriorityQueue { 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 { 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` + ) } } }