| 14 | #include "basics.h" |
| 15 | |
| 16 | int pq_less(struct pq_entry *a, struct pq_entry *b) |
| 17 | { |
| 18 | int cmp, err; |
| 19 | |
| 20 | err = reftable_record_cmp(a->rec, b->rec, &cmp); |
| 21 | if (err < 0) |
| 22 | return err; |
| 23 | |
| 24 | if (cmp == 0) |
| 25 | return a->index > b->index; |
| 26 | return cmp < 0; |
| 27 | } |
| 28 | |
| 29 | int merged_iter_pqueue_remove(struct merged_iter_pqueue *pq, struct pq_entry *out) |
| 30 | { |