mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-10 11:09:43 +08:00
Merge 587648a11e
into ca3d16dcce
This commit is contained in:
commit
73efc1c2ae
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user