X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fmessages.c;h=0eee5690d7feae1380aad512ede8110333d8f2b6;hp=7bcd1abfb4ce16791c6306c444215e1ae25418be;hb=d6e3905df7cacb14832cd045280347f36fb0be19;hpb=f3c1eebfaf8526129ae6946cbcd44a3c602563d6 diff --git a/lib/messages.c b/lib/messages.c index 7bcd1abf..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 * @@ -127,8 +116,10 @@ notmuch_messages_get (notmuch_messages_t *messages) void notmuch_messages_move_to_next (notmuch_messages_t *messages) { - if (! messages->is_of_list_type) - return _notmuch_mset_messages_move_to_next (messages); + if (! messages->is_of_list_type) { + _notmuch_mset_messages_move_to_next (messages); + return; + } if (messages->iterator == NULL) return;