Optimize nghttp2_pq swap
This commit is contained in:
parent
248a64f0b2
commit
228d92244a
|
@ -44,11 +44,13 @@ void nghttp2_pq_free(nghttp2_pq *pq) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void swap(nghttp2_pq *pq, size_t i, size_t j) {
|
static void swap(nghttp2_pq *pq, size_t i, size_t j) {
|
||||||
nghttp2_pq_entry *t = pq->q[i];
|
nghttp2_pq_entry *a = pq->q[i];
|
||||||
pq->q[i] = pq->q[j];
|
nghttp2_pq_entry *b = pq->q[j];
|
||||||
pq->q[i]->index = i;
|
|
||||||
pq->q[j] = t;
|
pq->q[i] = b;
|
||||||
pq->q[j]->index = j;
|
b->index = i;
|
||||||
|
pq->q[j] = a;
|
||||||
|
a->index = j;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bubble_up(nghttp2_pq *pq, size_t index) {
|
static void bubble_up(nghttp2_pq *pq, size_t index) {
|
||||||
|
|
Loading…
Reference in New Issue