--bucket
}
}
- if (this.size > 0) {
- --this.size
- }
+ this.decrementSize()
return this.nodeArray.shift()?.data
}
}
return this.size
}
+
+ /**
+ * Decrements the size of the priority queue.
+ *
+ * @returns The new size of the priority queue.
+ */
+ private decrementSize (): number {
+ if (this.size > 0) {
+ --this.size
+ }
+ return this.size
+ }
}