| 17 | } |
| 18 | |
| 19 | void prio_queue_reverse(struct prio_queue *queue) |
| 20 | { |
| 21 | size_t i, j; |
| 22 | |
| 23 | if (queue->compare) |
| 24 | BUG("prio_queue_reverse() on non-LIFO queue"); |
| 25 | if (!queue->nr) |
| 26 | return; |
| 27 | for (i = 0; i < (j = (queue->nr - 1) - i); i++) |
| 28 | swap(queue, i, j); |
| 29 | } |
| 30 | |
| 31 | void clear_prio_queue(struct prio_queue *queue) |
| 32 | { |