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 <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2019-04-30 11:01:20 +01:00
parent 4f38620b13
commit d5093350f3

View File

@ -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 were 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++;
}