Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / df / 70bcce604f26a0a379d3584a88acff522c9b34
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
9 X-Spam-Flag: NO\r
10 X-Spam-Score: -0.402\r
11 X-Spam-Level: \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
14  autolearn=disabled\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
20  [209.85.212.175])\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
35  vgyQ==\r
36 X-Gm-Message-State:\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
41  [188.238.79.131])\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
49 Message-Id:\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
58 Precedence: list\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
69 \r
70 Switch to normal glib hash table lookup. The extended version is only\r
71 required if the values may contain NULL.\r
72 ---\r
73  notmuch-search.c | 21 ++++++++++-----------\r
74  1 file changed, 10 insertions(+), 11 deletions(-)\r
75 \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
83  {\r
84 -    notmuch_bool_t duplicate;\r
85      char *key;\r
86      mailbox_t *mailbox;\r
87  \r
88 @@ -256,20 +255,20 @@ is_duplicate (const search_context_t *ctx, const char *name, const char *addr)\r
89      if (! key)\r
90         return FALSE;\r
91  \r
92 -    duplicate = g_hash_table_lookup_extended (ctx->addresses, key, NULL, (gpointer)&mailbox);\r
93 -\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
100 -    } else {\r
101 +    mailbox = g_hash_table_lookup (ctx->addresses, key);\r
102 +    if (mailbox) {\r
103         mailbox->count++;\r
104         talloc_free (key);\r
105 +       return TRUE;\r
106      }\r
107  \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
114 +\r
115 +    return FALSE;\r
116  }\r
117  \r
118  static void\r
119 -- \r
120 2.1.4\r
121 \r