From 097fb8b8aa220e209c7673a5713def137c91924c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 5 Jan 2023 14:38:10 -0700 Subject: [PATCH] [priority-queue] Use resize instead of shrink To avoid reallocation of smaller array. Not desirable here. --- src/hb-priority-queue.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-priority-queue.hh b/src/hb-priority-queue.hh index ac76b7d95..93a7842eb 100644 --- a/src/hb-priority-queue.hh +++ b/src/hb-priority-queue.hh @@ -62,7 +62,7 @@ struct hb_priority_queue_t item_t result = heap.arrayZ[0]; heap.arrayZ[0] = heap.arrayZ[heap.length - 1]; - heap.shrink (heap.length - 1); + heap.resize (heap.length - 1); if (!is_empty ()) bubble_down (0);