| 2 | #include "prio-queue.h" |
| 3 | |
| 4 | static inline int compare(struct prio_queue *queue, size_t i, size_t j) |
| 5 | { |
| 6 | int cmp = queue->compare(queue->array[i].data, queue->array[j].data, |
| 7 | queue->cb_data); |
| 8 | if (!cmp) |
| 9 | cmp = (queue->array[i].ctr > queue->array[j].ctr) - |
| 10 | (queue->array[i].ctr < queue->array[j].ctr); |
| 11 | return cmp; |
| 12 | } |
| 13 | |
| 14 | static inline void swap(struct prio_queue *queue, size_t i, size_t j) |
| 15 | { |
no outgoing calls
no test coverage detected