[PATCH 3/6] lib: Eliminate _notmuch_message_list_append
authorAustin Clements <amdragon@MIT.EDU>
Sun, 25 Nov 2012 04:57:04 +0000 (23:57 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:50:56 +0000 (09:50 -0800)
85/feb5673e168c64d350440fd9f852228ffddb3e [new file with mode: 0644]

diff --git a/85/feb5673e168c64d350440fd9f852228ffddb3e b/85/feb5673e168c64d350440fd9f852228ffddb3e
new file mode 100644 (file)
index 0000000..b9cee6b
--- /dev/null
@@ -0,0 +1,132 @@
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id A2FB4431FCF\r
+       for <notmuch@notmuchmail.org>; Sat, 24 Nov 2012 20:57:30 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id m-IGL6SD6IUe for <notmuch@notmuchmail.org>;\r
+       Sat, 24 Nov 2012 20:57:29 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU\r
+       [18.9.25.14])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1C2C1431FCB\r
+       for <notmuch@notmuchmail.org>; Sat, 24 Nov 2012 20:57:27 -0800 (PST)\r
+X-AuditID: 1209190e-b7f756d000000904-91-50b1a537fe1d\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 2E.69.02308.735A1B05; Sat, 24 Nov 2012 23:57:27 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id qAP4vG0X012785; \r
+       Sat, 24 Nov 2012 23:57:16 -0500\r
+Received: from drake.dyndns.org\r
+       (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+       [209.6.116.242]) (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qAP4vEva000083\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Sat, 24 Nov 2012 23:57:16 -0500 (EST)\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1TcUHJ-0003Zp-U0; Sat, 24 Nov 2012 23:57:13 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 3/6] lib: Eliminate _notmuch_message_list_append\r
+Date: Sat, 24 Nov 2012 23:57:04 -0500\r
+Message-Id: <1353819427-13182-4-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <1353819427-13182-1-git-send-email-amdragon@mit.edu>\r
+References: <1353819427-13182-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrNIsWRmVeSWpSXmKPExsUixG6nrmu+dGOAweceNYvVc3ksrt+cyezA\r
+       5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZez/+oSxYAtvxbqVfUwNjA+5uhg5OSQETCRu\r
+       t6xigrDFJC7cW8/WxcjFISSwj1FiyZ31jCAJIYENjBInvwRDJB4xSTTc2cUM4cxllNiweQYr\r
+       SBWbgIbEtv3LwTpEBKQldt6dDRZnFnCU+Lx/ERuILSzgILFi5hVmEJtFQFXi8Nxd7CA2L1B8\r
+       /d8PrBBnKEp0P5sAVM/BwQnU27hXDuIIB4lb/yYxT2DkX8DIsIpRNiW3Sjc3MTOnODVZtzg5\r
+       MS8vtUjXWC83s0QvNaV0EyMojDgl+XYwfj2odIhRgINRiYf3RuLGACHWxLLiytxDjJIcTEqi\r
+       vJmLgEJ8SfkplRmJxRnxRaU5qcWHGCU4mJVEeK1VgXK8KYmVValF+TApaQ4WJXHeKyk3/YUE\r
+       0hNLUrNTUwtSi2CyMhwcShK8IkuAGgWLUtNTK9Iyc0oQ0kwcnCDDeYCGi4LU8BYXJOYWZ6ZD\r
+       5E8xKkqJ835eDJQQAElklObB9cLi/BWjONArwrxMIO08wBQB1/0KaDAT0OCns9eBDC5JREhJ\r
+       NTAyaL2QeSYb6HCU0+T/0TO/d7anH3Db/bdONEtW/+HeuQU3lsmlNW3hu5Z0+82Kc5zTzh38\r
+       l+B15zfXzLuqDdNfxV9s7lOYIxtVL+6y/abYh+2T7zIfvy9nk//K+2ZehKzaMa2O+QGK7zwW\r
+       L6uYd+7Lzjgrj0Ttxc6/Hh+Kub1O7YRLk0yYy6sVSizFGYmGWsxFxYkAxeozpM4CAAA=\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 25 Nov 2012 04:57:31 -0000\r
+\r
+This API invited micro-optimized and complicated list pointer\r
+manipulation and is no longer used.\r
+---\r
+ lib/messages.c        |   17 +++--------------\r
+ lib/notmuch-private.h |    4 ----\r
+ 2 files changed, 3 insertions(+), 18 deletions(-)\r
+\r
+diff --git a/lib/messages.c b/lib/messages.c\r
+index 1121864..0eee569 100644\r
+--- a/lib/messages.c\r
++++ b/lib/messages.c\r
+@@ -42,19 +42,7 @@ _notmuch_message_list_create (const void *ctx)\r
+     return list;\r
+ }\r
\r
+-/* Append a single 'node' to the end of 'list'.\r
+- */\r
+-void\r
+-_notmuch_message_list_append (notmuch_message_list_t *list,\r
+-                            notmuch_message_node_t *node)\r
+-{\r
+-    *(list->tail) = node;\r
+-    list->tail = &node->next;\r
+-}\r
+-\r
+-/* Allocate a new node for 'message' and append it to the end of\r
+- * 'list'.\r
+- */\r
++/* Append 'message' to the end of 'list'. */\r
+ void\r
+ _notmuch_message_list_add_message (notmuch_message_list_t *list,\r
+                                  notmuch_message_t *message)\r
+@@ -64,7 +52,8 @@ _notmuch_message_list_add_message (notmuch_message_list_t *list,\r
+     node->message = message;\r
+     node->next = NULL;\r
\r
+-    _notmuch_message_list_append (list, node);\r
++    *(list->tail) = node;\r
++    list->tail = &node->next;\r
+ }\r
\r
+ notmuch_messages_t *\r
+diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h\r
+index c054a0e..f38ccb3 100644\r
+--- a/lib/notmuch-private.h\r
++++ b/lib/notmuch-private.h\r
+@@ -429,10 +429,6 @@ notmuch_message_list_t *\r
+ _notmuch_message_list_create (const void *ctx);\r
\r
+ void\r
+-_notmuch_message_list_append (notmuch_message_list_t *list,\r
+-                            notmuch_message_node_t *node);\r
+-\r
+-void\r
+ _notmuch_message_list_add_message (notmuch_message_list_t *list,\r
+                                  notmuch_message_t *message);\r
\r
+-- \r
+1.7.10.4\r
+\r