1 Return-Path: <bremner@tesseract.cs.unb.ca>
\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 olra.theworths.org (Postfix) with ESMTP id 4BC61431FAF
\r
6 for <notmuch@notmuchmail.org>; Fri, 2 Jan 2015 08:21:08 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id DiY9hNMJjNdg for <notmuch@notmuchmail.org>;
\r
16 Fri, 2 Jan 2015 08:21:05 -0800 (PST)
\r
17 Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])
\r
18 (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 210C8431FAE
\r
21 for <notmuch@notmuchmail.org>; Fri, 2 Jan 2015 08:21:05 -0800 (PST)
\r
22 Received: from remotemail by yantan.tethera.net with local (Exim 4.80)
\r
23 (envelope-from <bremner@tesseract.cs.unb.ca>)
\r
24 id 1Y74yD-0007Rv-62; Fri, 02 Jan 2015 12:21:01 -0400
\r
25 Received: (nullmailer pid 4224 invoked by uid 1000); Fri, 02 Jan 2015
\r
27 From: David Bremner <david@tethera.net>
\r
28 To: notmuch@notmuchmail.org
\r
29 Subject: [PATCH] lib: convert two "iterator copy strings" into references.
\r
30 Date: Fri, 2 Jan 2015 17:20:52 +0100
\r
31 Message-Id: <1420215652-4131-1-git-send-email-david@tethera.net>
\r
32 X-Mailer: git-send-email 2.1.3
\r
33 In-Reply-To: <1419763508-11902-1-git-send-email-david@tethera.net>
\r
34 References: <1419763508-11902-1-git-send-email-david@tethera.net>
\r
35 X-BeenThere: notmuch@notmuchmail.org
\r
36 X-Mailman-Version: 2.1.13
\r
38 List-Id: "Use and development of the notmuch mail system."
\r
39 <notmuch.notmuchmail.org>
\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
41 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
43 List-Post: <mailto:notmuch@notmuchmail.org>
\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
47 X-List-Received-Date: Fri, 02 Jan 2015 16:21:08 -0000
\r
49 Apparently this is a supported and even idiomatic way of keeping a
\r
50 temporary object (e.g. like that returned from an operator
\r
54 I decided it was better to do both of these "keepalive" strings the
\r
55 same way, so I applied the parent patch as is.
\r
57 lib/message.cc | 4 ++--
\r
58 1 file changed, 2 insertions(+), 2 deletions(-)
\r
60 diff --git a/lib/message.cc b/lib/message.cc
\r
61 index bacb4d4..956a70a 100644
\r
62 --- a/lib/message.cc
\r
63 +++ b/lib/message.cc
\r
64 @@ -283,7 +283,7 @@ _notmuch_message_get_term (notmuch_message_t *message,
\r
68 - std::string term = *i;
\r
69 + const std::string &term = *i;
\r
70 if (strncmp (term.c_str(), prefix, prefix_len))
\r
73 @@ -641,7 +641,7 @@ _notmuch_message_add_directory_terms (void *ctx, notmuch_message_t *message)
\r
74 unsigned int directory_id;
\r
75 const char *direntry, *directory;
\r
77 - const std::string term = *i;
\r
78 + const std::string &term = *i;
\r
80 /* Terminate loop at first term without desired prefix. */
\r
81 if (strncmp (term.c_str (), direntry_prefix, direntry_prefix_len))
\r