()
| 35 | } |
| 36 | |
| 37 | func (q *queue) Pop() any { |
| 38 | old := *q |
| 39 | n := len(old) |
| 40 | x := old[n-1] |
| 41 | *q = old[0 : n-1] |
| 42 | return x |
| 43 | } |
| 44 | |
| 45 | // NewPriorityQueue makes a new priority queue. |
| 46 | func NewPriorityQueue(lengthGauge prometheus.Gauge) *PriorityQueue { |