) {
if (!Number.isSafeInteger(bucketSize)) {
throw new TypeError(
- `Invalid bucket size: '${bucketSize}' is not an integer`
+ `Invalid bucket size: '${bucketSize.toString()}' is not an integer`
)
}
if (bucketSize < 0) {
- throw new RangeError(`Invalid bucket size: ${bucketSize} < 0`)
+ throw new RangeError(`Invalid bucket size: ${bucketSize.toString()} < 0`)
}
this.bucketSize = bucketSize
this.head = this.tail = new FixedPriorityQueue(
/**
* The priority queue size.
+ * @returns The priority queue size.
*/
public get size (): number {
let node: PriorityQueueNode<T> | undefined = this.tail
/**
* The number of filled prioritized buckets.
+ * @returns The number of filled prioritized buckets.
*/
public get buckets (): number {
return Math.trunc(this.size / this.bucketSize)