Commit 228d9224 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Optimize nghttp2_pq swap

parent 248a64f0
......@@ -44,11 +44,13 @@ void nghttp2_pq_free(nghttp2_pq *pq) {
}
static void swap(nghttp2_pq *pq, size_t i, size_t j) {
nghttp2_pq_entry *t = pq->q[i];
pq->q[i] = pq->q[j];
pq->q[i]->index = i;
pq->q[j] = t;
pq->q[j]->index = j;
nghttp2_pq_entry *a = pq->q[i];
nghttp2_pq_entry *b = pq->q[j];
pq->q[i] = b;
b->index = i;
pq->q[j] = a;
a->index = j;
}
static void bubble_up(nghttp2_pq *pq, size_t index) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment