From 134aad35f9bf9796d977e9884bbbb13e483fac6d Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Wed, 21 Oct 2020 18:33:21 -0400 Subject: [PATCH] chore: remove redundant highest_priority updates --- runtime/src/priority_queue.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/runtime/src/priority_queue.c b/runtime/src/priority_queue.c index 63beff7..6d057c9 100644 --- a/runtime/src/priority_queue.c +++ b/runtime/src/priority_queue.c @@ -374,14 +374,7 @@ priority_queue_dequeue_if_earlier_nolock(struct priority_queue *self, void **deq self->items[1] = self->items[self->size]; self->items[self->size--] = NULL; - if (self->size > 1) priority_queue_percolate_down(self, 1); - - /* Update the highest priority */ - if (!priority_queue_is_empty(self)) { - priority_queue_update_highest_priority(self, self->get_priority_fn(self->items[1])); - } else { - priority_queue_update_highest_priority(self, ULONG_MAX); - } + priority_queue_percolate_down(self, 1); return_code = 0; done: