[priority-queue] Use resize instead of shrink
To avoid reallocation of smaller array. Not desirable here.
This commit is contained in:
parent
8a17cc4ecf
commit
097fb8b8aa
|
@ -62,7 +62,7 @@ struct hb_priority_queue_t
|
||||||
item_t result = heap.arrayZ[0];
|
item_t result = heap.arrayZ[0];
|
||||||
|
|
||||||
heap.arrayZ[0] = heap.arrayZ[heap.length - 1];
|
heap.arrayZ[0] = heap.arrayZ[heap.length - 1];
|
||||||
heap.shrink (heap.length - 1);
|
heap.resize (heap.length - 1);
|
||||||
|
|
||||||
if (!is_empty ())
|
if (!is_empty ())
|
||||||
bubble_down (0);
|
bubble_down (0);
|
||||||
|
|
Loading…
Reference in New Issue