1 Return-Path: <jani@nikula.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by arlo.cworth.org (Postfix) with ESMTP id 1C4586DE14F4
\r
6 for <notmuch@notmuchmail.org>; Thu, 3 Sep 2015 12:40:15 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
10 X-Spam-Score: -0.402
\r
12 X-Spam-Status: No, score=-0.402 tagged_above=-999 required=5 tests=[AWL=0.318,
\r
13 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01]
\r
15 Received: from arlo.cworth.org ([127.0.0.1])
\r
16 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id pZTB8h-iiALy for <notmuch@notmuchmail.org>;
\r
18 Thu, 3 Sep 2015 12:40:13 -0700 (PDT)
\r
19 Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com
\r
21 by arlo.cworth.org (Postfix) with ESMTPS id 162086DE1533
\r
22 for <notmuch@notmuchmail.org>; Thu, 3 Sep 2015 12:40:13 -0700 (PDT)
\r
23 Received: by wicge5 with SMTP id ge5so84699959wic.0
\r
24 for <notmuch@notmuchmail.org>; Thu, 03 Sep 2015 12:40:11 -0700 (PDT)
\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=1e100.net; s=20130820;
\r
27 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
\r
28 :references:in-reply-to:references;
\r
29 bh=oOK9FwQQJYfJ8EEw/WSzOC9eP/5F8JfiWJh6LE9dUxo=;
\r
30 b=H6YFLaMpaYMmkTg7LhRHDwy8jSrRIb6BbrVa/E9K9tICXxVucP3JlyQILG6cGKFcH6
\r
31 z5Mwqj2blQuSxnYAq46oSb2Xhym1JfdJOkTKS9FUbWWYdVUDGLv20Bo14E92tmxSk4bJ
\r
32 7l91Yf0U5PjXLPlzy0lvYhKL3zGZbbRdWFG1/tm0JKe4cks22Zf1XVtVwttKc8HyoCKH
\r
33 X6hijvgokyducSl+KvY9iZjqmGTMD9UY+u81ZaXWybscSqfl8yIWWg0lBuz0KVU/0YZS
\r
34 4ynyzGo482Y6f8oy18/hOGDCOq/nWG70iMX4RS3XEPeNYag9Ej753UvRXXoyUxu54s6F
\r
37 ALoCoQl6gz9bo05YuhXx12DCWwemBRZQdpfzK45PxvCV3ZVJC1KD7pfam9IjXsZkCrnandeEX7gt
\r
38 X-Received: by 10.180.23.132 with SMTP id m4mr1359977wif.89.1441309211337;
\r
39 Thu, 03 Sep 2015 12:40:11 -0700 (PDT)
\r
40 Received: from localhost (mobile-access-bcee4f-131.dhcp.inet.fi.
\r
42 by smtp.gmail.com with ESMTPSA id bq7sm39243253wjc.31.2015.09.03.12.40.10
\r
43 (version=TLSv1/SSLv3 cipher=OTHER);
\r
44 Thu, 03 Sep 2015 12:40:10 -0700 (PDT)
\r
45 From: Jani Nikula <jani@nikula.org>
\r
46 To: notmuch@notmuchmail.org
\r
47 Subject: [PATCH v2 1/9] cli: g_hash_table_lookup_extended is overkill
\r
48 Date: Thu, 3 Sep 2015 22:39:57 +0300
\r
50 <4e640f9d373e9c07129e6f1f0ddbe4d1bb4febd9.1441308761.git.jani@nikula.org>
\r
51 X-Mailer: git-send-email 2.1.4
\r
52 In-Reply-To: <cover.1441308761.git.jani@nikula.org>
\r
53 References: <cover.1441308761.git.jani@nikula.org>
\r
54 In-Reply-To: <cover.1441308761.git.jani@nikula.org>
\r
55 References: <cover.1441308761.git.jani@nikula.org>
\r
56 X-BeenThere: notmuch@notmuchmail.org
\r
57 X-Mailman-Version: 2.1.18
\r
59 List-Id: "Use and development of the notmuch mail system."
\r
60 <notmuch.notmuchmail.org>
\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
64 List-Post: <mailto:notmuch@notmuchmail.org>
\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
67 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
68 X-List-Received-Date: Thu, 03 Sep 2015 19:40:15 -0000
\r
70 Switch to normal glib hash table lookup. The extended version is only
\r
71 required if the values may contain NULL.
\r
73 notmuch-search.c | 21 ++++++++++-----------
\r
74 1 file changed, 10 insertions(+), 11 deletions(-)
\r
76 diff --git a/notmuch-search.c b/notmuch-search.c
\r
77 index 3076c3f637b1..7fdc6acaa2fe 100644
\r
78 --- a/notmuch-search.c
\r
79 +++ b/notmuch-search.c
\r
80 @@ -248,7 +248,6 @@ do_search_threads (search_context_t *ctx)
\r
81 static notmuch_bool_t
\r
82 is_duplicate (const search_context_t *ctx, const char *name, const char *addr)
\r
84 - notmuch_bool_t duplicate;
\r
88 @@ -256,20 +255,20 @@ is_duplicate (const search_context_t *ctx, const char *name, const char *addr)
\r
92 - duplicate = g_hash_table_lookup_extended (ctx->addresses, key, NULL, (gpointer)&mailbox);
\r
94 - if (! duplicate) {
\r
95 - mailbox = talloc (ctx->format, mailbox_t);
\r
96 - mailbox->name = talloc_strdup (mailbox, name);
\r
97 - mailbox->addr = talloc_strdup (mailbox, addr);
\r
98 - mailbox->count = 1;
\r
99 - g_hash_table_insert (ctx->addresses, key, mailbox);
\r
101 + mailbox = g_hash_table_lookup (ctx->addresses, key);
\r
108 - return duplicate;
\r
109 + mailbox = talloc (ctx->format, mailbox_t);
\r
110 + mailbox->name = talloc_strdup (mailbox, name);
\r
111 + mailbox->addr = talloc_strdup (mailbox, addr);
\r
112 + mailbox->count = 1;
\r
113 + g_hash_table_insert (ctx->addresses, key, mailbox);
\r