Lines Matching defs:index
52 b->index = i;
54 a->index = j;
57 static void bubble_up(nghttp3_pq *pq, size_t index) {
59 while (index != 0) {
60 parent = (index - 1) / 2;
61 if (!pq->less(pq->q[index], pq->q[parent])) {
64 swap(pq, parent, index);
65 index = parent;
85 item->index = pq->length;
96 static void bubble_down(nghttp3_pq *pq, size_t index) {
99 j = index * 2 + 1;
100 minindex = index;
109 if (minindex == index) {
112 swap(pq, index, minindex);
113 index = minindex;
120 pq->q[0]->index = 0;
127 assert(pq->q[item->index] == item);
129 if (item->index == 0) {
134 if (item->index == pq->length - 1) {
139 pq->q[item->index] = pq->q[pq->length - 1];
140 pq->q[item->index]->index = item->index;
143 if (pq->less(item, pq->q[item->index])) {
144 bubble_down(pq, item->index);
146 bubble_up(pq, item->index);