| 497 | } |
| 498 | |
| 499 | static int iq_bubble_down(h2_iqueue *q, int i, int bottom, |
| 500 | h2_iq_cmp *cmp, void *ctx) |
| 501 | { |
| 502 | int next; |
| 503 | while (((next = (q->nalloc + i + 1) % q->nalloc), i != bottom) |
| 504 | && (*cmp)(q->elts[i], q->elts[next], ctx) > 0) { |
| 505 | iq_swap(q, next, i); |
| 506 | i = next; |
| 507 | } |
| 508 | return i; |
| 509 | } |
| 510 | |
| 511 | int h2_iq_contains(h2_iqueue *q, int sid) |
| 512 | { |