[priority-queue] Optimize swap()
This commit is contained in:
parent
c7317ef761
commit
9308659fd7
|
@ -142,9 +142,9 @@ struct hb_priority_queue_t
|
||||||
|
|
||||||
void swap (unsigned a, unsigned b)
|
void swap (unsigned a, unsigned b)
|
||||||
{
|
{
|
||||||
item_t temp = heap[a];
|
assert (a <= heap.length);
|
||||||
heap[a] = heap[b];
|
assert (b <= heap.length);
|
||||||
heap[b] = temp;
|
hb_swap (heap.arrayZ[a], heap.arrayZ[b]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue