lib: Eliminate _notmuch_message_list_append

This API invited micro-optimized and complicated list pointer
manipulation and is no longer used.
This commit is contained in:
Austin Clements 2012-11-24 23:57:04 -05:00 committed by David Bremner
parent 5394924e6c
commit d6e3905df7
2 changed files with 3 additions and 18 deletions

View file

@ -42,19 +42,7 @@ _notmuch_message_list_create (const void *ctx)
return list; return list;
} }
/* Append a single 'node' to the end of 'list'. /* Append 'message' 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'.
*/
void void
_notmuch_message_list_add_message (notmuch_message_list_t *list, _notmuch_message_list_add_message (notmuch_message_list_t *list,
notmuch_message_t *message) notmuch_message_t *message)
@ -64,7 +52,8 @@ _notmuch_message_list_add_message (notmuch_message_list_t *list,
node->message = message; node->message = message;
node->next = NULL; node->next = NULL;
_notmuch_message_list_append (list, node); *(list->tail) = node;
list->tail = &node->next;
} }
notmuch_messages_t * notmuch_messages_t *

View file

@ -428,10 +428,6 @@ struct visible _notmuch_messages {
notmuch_message_list_t * notmuch_message_list_t *
_notmuch_message_list_create (const void *ctx); _notmuch_message_list_create (const void *ctx);
void
_notmuch_message_list_append (notmuch_message_list_t *list,
notmuch_message_node_t *node);
void void
_notmuch_message_list_add_message (notmuch_message_list_t *list, _notmuch_message_list_add_message (notmuch_message_list_t *list,
notmuch_message_t *message); notmuch_message_t *message);