--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 1C4586DE14F4\r
+ for <notmuch@notmuchmail.org>; Thu, 3 Sep 2015 12:40:15 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.402\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.402 tagged_above=-999 required=5 tests=[AWL=0.318,\r
+ RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id pZTB8h-iiALy for <notmuch@notmuchmail.org>;\r
+ Thu, 3 Sep 2015 12:40:13 -0700 (PDT)\r
+Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com\r
+ [209.85.212.175])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 162086DE1533\r
+ for <notmuch@notmuchmail.org>; Thu, 3 Sep 2015 12:40:13 -0700 (PDT)\r
+Received: by wicge5 with SMTP id ge5so84699959wic.0\r
+ for <notmuch@notmuchmail.org>; Thu, 03 Sep 2015 12:40:11 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+ :references:in-reply-to:references;\r
+ bh=oOK9FwQQJYfJ8EEw/WSzOC9eP/5F8JfiWJh6LE9dUxo=;\r
+ b=H6YFLaMpaYMmkTg7LhRHDwy8jSrRIb6BbrVa/E9K9tICXxVucP3JlyQILG6cGKFcH6\r
+ z5Mwqj2blQuSxnYAq46oSb2Xhym1JfdJOkTKS9FUbWWYdVUDGLv20Bo14E92tmxSk4bJ\r
+ 7l91Yf0U5PjXLPlzy0lvYhKL3zGZbbRdWFG1/tm0JKe4cks22Zf1XVtVwttKc8HyoCKH\r
+ X6hijvgokyducSl+KvY9iZjqmGTMD9UY+u81ZaXWybscSqfl8yIWWg0lBuz0KVU/0YZS\r
+ 4ynyzGo482Y6f8oy18/hOGDCOq/nWG70iMX4RS3XEPeNYag9Ej753UvRXXoyUxu54s6F\r
+ vgyQ==\r
+X-Gm-Message-State:\r
+ ALoCoQl6gz9bo05YuhXx12DCWwemBRZQdpfzK45PxvCV3ZVJC1KD7pfam9IjXsZkCrnandeEX7gt\r
+X-Received: by 10.180.23.132 with SMTP id m4mr1359977wif.89.1441309211337;\r
+ Thu, 03 Sep 2015 12:40:11 -0700 (PDT)\r
+Received: from localhost (mobile-access-bcee4f-131.dhcp.inet.fi.\r
+ [188.238.79.131])\r
+ by smtp.gmail.com with ESMTPSA id bq7sm39243253wjc.31.2015.09.03.12.40.10\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Thu, 03 Sep 2015 12:40:10 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 1/9] cli: g_hash_table_lookup_extended is overkill\r
+Date: Thu, 3 Sep 2015 22:39:57 +0300\r
+Message-Id:\r
+ <4e640f9d373e9c07129e6f1f0ddbe4d1bb4febd9.1441308761.git.jani@nikula.org>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <cover.1441308761.git.jani@nikula.org>\r
+References: <cover.1441308761.git.jani@nikula.org>\r
+In-Reply-To: <cover.1441308761.git.jani@nikula.org>\r
+References: <cover.1441308761.git.jani@nikula.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\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: Thu, 03 Sep 2015 19:40:15 -0000\r
+\r
+Switch to normal glib hash table lookup. The extended version is only\r
+required if the values may contain NULL.\r
+---\r
+ notmuch-search.c | 21 ++++++++++-----------\r
+ 1 file changed, 10 insertions(+), 11 deletions(-)\r
+\r
+diff --git a/notmuch-search.c b/notmuch-search.c\r
+index 3076c3f637b1..7fdc6acaa2fe 100644\r
+--- a/notmuch-search.c\r
++++ b/notmuch-search.c\r
+@@ -248,7 +248,6 @@ do_search_threads (search_context_t *ctx)\r
+ static notmuch_bool_t\r
+ is_duplicate (const search_context_t *ctx, const char *name, const char *addr)\r
+ {\r
+- notmuch_bool_t duplicate;\r
+ char *key;\r
+ mailbox_t *mailbox;\r
+ \r
+@@ -256,20 +255,20 @@ is_duplicate (const search_context_t *ctx, const char *name, const char *addr)\r
+ if (! key)\r
+ return FALSE;\r
+ \r
+- duplicate = g_hash_table_lookup_extended (ctx->addresses, key, NULL, (gpointer)&mailbox);\r
+-\r
+- if (! duplicate) {\r
+- mailbox = talloc (ctx->format, mailbox_t);\r
+- mailbox->name = talloc_strdup (mailbox, name);\r
+- mailbox->addr = talloc_strdup (mailbox, addr);\r
+- mailbox->count = 1;\r
+- g_hash_table_insert (ctx->addresses, key, mailbox);\r
+- } else {\r
++ mailbox = g_hash_table_lookup (ctx->addresses, key);\r
++ if (mailbox) {\r
+ mailbox->count++;\r
+ talloc_free (key);\r
++ return TRUE;\r
+ }\r
+ \r
+- return duplicate;\r
++ mailbox = talloc (ctx->format, mailbox_t);\r
++ mailbox->name = talloc_strdup (mailbox, name);\r
++ mailbox->addr = talloc_strdup (mailbox, addr);\r
++ mailbox->count = 1;\r
++ g_hash_table_insert (ctx->addresses, key, mailbox);\r
++\r
++ return FALSE;\r
+ }\r
+ \r
+ static void\r
+-- \r
+2.1.4\r
+\r