1 Return-Path: <david@tethera.net>
\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 4C0806DE01F7
\r
6 for <notmuch@notmuchmail.org>; Tue, 24 May 2016 04:55:06 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=-0.012 tagged_above=-999 required=5
\r
12 tests=[AWL=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01]
\r
14 Received: from arlo.cworth.org ([127.0.0.1])
\r
15 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id zl1L6mOjJ4Wf for <notmuch@notmuchmail.org>;
\r
17 Tue, 24 May 2016 04:54:58 -0700 (PDT)
\r
18 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])
\r
19 by arlo.cworth.org (Postfix) with ESMTPS id E5EEA6DE00C6
\r
20 for <notmuch@notmuchmail.org>; Tue, 24 May 2016 04:54:57 -0700 (PDT)
\r
21 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)
\r
22 (envelope-from <david@tethera.net>)
\r
23 id 1b5AvA-0004Ix-Tt; Tue, 24 May 2016 07:54:48 -0400
\r
24 Received: (nullmailer pid 22619 invoked by uid 1000);
\r
25 Tue, 24 May 2016 11:54:55 -0000
\r
26 From: David Bremner <david@tethera.net>
\r
27 To: notmuch@notmuchmail.org
\r
28 Subject: Re: [Patch v5 06/11] lib: config list iterators
\r
29 In-Reply-To: <1463135893-7471-7-git-send-email-david@tethera.net>
\r
30 References: <1463135893-7471-1-git-send-email-david@tethera.net>
\r
31 <1463135893-7471-7-git-send-email-david@tethera.net>
\r
32 User-Agent: Notmuch/0.22+15~g1aa6f90 (http://notmuchmail.org) Emacs/24.5.1
\r
33 (x86_64-pc-linux-gnu)
\r
34 Date: Tue, 24 May 2016 08:54:55 -0300
\r
35 Message-ID: <87fut7n01c.fsf@zancas.localnet>
\r
37 Content-Type: text/plain
\r
38 X-BeenThere: notmuch@notmuchmail.org
\r
39 X-Mailman-Version: 2.1.20
\r
41 List-Id: "Use and development of the notmuch mail system."
\r
42 <notmuch.notmuchmail.org>
\r
43 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
46 List-Post: <mailto:notmuch@notmuchmail.org>
\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
48 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
50 X-List-Received-Date: Tue, 24 May 2016 11:55:06 -0000
\r
52 David Bremner <david@tethera.net> writes:
\r
55 > + talloc_set_destructor (list, _notmuch_config_list_destroy);
\r
56 > + list->iterator = new Xapian::TermIterator;
\r
57 > + list->notmuch = notmuch;
\r
58 > + list->current_key = NULL;
\r
59 > + list->current_val = NULL;
\r
63 > + *list->iterator = notmuch->xapian_db->metadata_keys_begin (CONFIG_PREFIX + (prefix ? prefix : ""));
\r
66 minimally these two assignments to list->iterator should be right next
\r
67 to each other, with a comment explaining what the heck. But I think the
\r
68 following is more idiomatic
\r
70 - /* force copying onto the heap */
\r
71 - list->iterator = new Xapian::TermIterator;
\r
72 - *list->iterator = notmuch->xapian_db->metadata_keys_begin (CONFIG_PREFIX + (prefix ? prefix : ""));
\r
73 + list->iterator = new Xapian::TermIterator(notmuch->xapian_db->metadata_keys_begin
\r
74 + (CONFIG_PREFIX + (prefix ? prefix : "")));
\r
76 so that's what I've done in git
\r