Lines Matching defs:index
50 b->index = i;
52 a->index = j;
55 static void bubble_up(nghttp2_pq *pq, size_t index) {
57 while (index != 0) {
58 parent = (index - 1) / 2;
59 if (!pq->less(pq->q[index], pq->q[parent])) {
62 swap(pq, parent, index);
63 index = parent;
83 item->index = pq->length;
97 static void bubble_down(nghttp2_pq *pq, size_t index) {
100 j = index * 2 + 1;
101 minindex = index;
110 if (minindex == index) {
113 swap(pq, index, minindex);
114 index = minindex;
121 pq->q[0]->index = 0;
128 assert(pq->q[item->index] == item);
130 if (item->index == 0) {
135 if (item->index == pq->length - 1) {
140 pq->q[item->index] = pq->q[pq->length - 1];
141 pq->q[item->index]->index = item->index;
144 if (pq->less(item, pq->q[item->index])) {
145 bubble_down(pq, item->index);
147 bubble_up(pq, item->index);