From: Austin Clements Date: Sun, 25 Nov 2012 04:57:04 +0000 (-0500) Subject: lib: Eliminate _notmuch_message_list_append X-Git-Tag: 0.16_rc1~204 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=d6e3905df7cacb14832cd045280347f36fb0be19 lib: Eliminate _notmuch_message_list_append This API invited micro-optimized and complicated list pointer manipulation and is no longer used. --- diff --git a/lib/messages.c b/lib/messages.c index 11218648..0eee5690 100644 --- a/lib/messages.c +++ b/lib/messages.c @@ -42,19 +42,7 @@ _notmuch_message_list_create (const void *ctx) return list; } -/* Append a single 'node' to the end of 'list'. - */ -void -_notmuch_message_list_append (notmuch_message_list_t *list, - notmuch_message_node_t *node) -{ - *(list->tail) = node; - list->tail = &node->next; -} - -/* Allocate a new node for 'message' and append it to the end of - * 'list'. - */ +/* Append 'message' to the end of 'list'. */ void _notmuch_message_list_add_message (notmuch_message_list_t *list, notmuch_message_t *message) @@ -64,7 +52,8 @@ _notmuch_message_list_add_message (notmuch_message_list_t *list, node->message = message; node->next = NULL; - _notmuch_message_list_append (list, node); + *(list->tail) = node; + list->tail = &node->next; } notmuch_messages_t * diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h index c054a0e9..f38ccb39 100644 --- a/lib/notmuch-private.h +++ b/lib/notmuch-private.h @@ -428,10 +428,6 @@ struct visible _notmuch_messages { notmuch_message_list_t * _notmuch_message_list_create (const void *ctx); -void -_notmuch_message_list_append (notmuch_message_list_t *list, - notmuch_message_node_t *node); - void _notmuch_message_list_add_message (notmuch_message_list_t *list, notmuch_message_t *message);