mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-13 06:23:00 +08:00
Merge 587648a11e
into 2c67b48c21
This commit is contained in:
commit
49f15c4532
@ -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