From d5093350f3ea6a28bd02e4ed05466f83eacbd660 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 30 Apr 2019 11:01:20 +0100 Subject: [PATCH] gqueue: Remove a redundant branch queue->tail->next cannot be non-NULL, as pushing onto the end of the queue is handled by the call to g_queue_push_tail_link() above. Signed-off-by: Philip Withnall --- glib/gqueue.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/glib/gqueue.c b/glib/gqueue.c index e8c938a25..0cc7ab200 100644 --- a/glib/gqueue.c +++ b/glib/gqueue.c @@ -519,8 +519,10 @@ g_queue_push_nth_link (GQueue *queue, if (queue->head->prev) queue->head = queue->head->prev; - if (queue->tail->next) - queue->tail = queue->tail->next; + /* The case where we’re pushing @link_ at the end of @queue is handled above + * using g_queue_push_tail_link(), so we should never have to manually adjust + * queue->tail. */ + g_assert (queue->tail->next == NULL); queue->length++; }