]> git.cworth.org Git - obsolete/notmuch-old/commitdiff
lib: Eliminate _notmuch_message_list_append
authorAustin Clements <amdragon@MIT.EDU>
Sun, 25 Nov 2012 04:57:04 +0000 (23:57 -0500)
committerDavid Bremner <bremner@debian.org>
Tue, 19 Feb 2013 00:20:38 +0000 (20:20 -0400)
This API invited micro-optimized and complicated list pointer
manipulation and is no longer used.

lib/messages.c
lib/notmuch-private.h

index 11218648f8c15f86f5a5dd6c5c0ece696577e46a..0eee5690d7feae1380aad512ede8110333d8f2b6 100644 (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'.
- */
-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)
 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;
 
     node->message = message;
     node->next = NULL;
 
-    _notmuch_message_list_append (list, node);
+    *(list->tail) = node;
+    list->tail = &node->next;
 }
 
 notmuch_messages_t *
 }
 
 notmuch_messages_t *
index c054a0e907b6ab0cfdb6d135d0b6a6a4c390507f..f38ccb39b1ecfcbc5884341fc4024f50762665e4 100644 (file)
@@ -428,10 +428,6 @@ struct visible _notmuch_messages {
 notmuch_message_list_t *
 _notmuch_message_list_create (const void *ctx);
 
 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);
 void
 _notmuch_message_list_add_message (notmuch_message_list_t *list,
                                   notmuch_message_t *message);