This commit is contained in:
PradeepG-07 2024-07-14 03:51:53 +05:00 committed by GitHub
commit 73efc1c2ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,7 +22,7 @@ export default class PriorityQueue extends MinHeap {
* @param {number} [priority] - items priority.
* @return {PriorityQueue}
*/
add(item, priority = 0) {
add(item, priority = item) {
this.priorities.set(item, priority);
super.add(item);
return this;