* Enqueues an item with the given priority. * @param {T} item * @param {number} priority
(item, priority)
| 32 | * @param {number} priority |
| 33 | */ |
| 34 | enqueue(item, priority) { |
| 35 | if (isNaN(priority)) { |
| 36 | throw new Error('Priority must not be NaN.'); |
| 37 | } |
| 38 | const i = this.binarySearch_(priority); |
| 39 | this.queue_.splice(i, 0, {item, priority}); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Returns index at which item with `target` priority should be inserted. |
nothing calls this directly
no test coverage detected