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 olra.theworths.org (Postfix) with ESMTP id A9E1A431FBC
\r
6 for <notmuch@notmuchmail.org>; Thu, 2 May 2013 13:36:41 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\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 QsySbbVg337W for <notmuch@notmuchmail.org>;
\r
16 Thu, 2 May 2013 13:36:37 -0700 (PDT)
\r
17 Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com
\r
18 [209.85.217.174]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 569D0431FAF
\r
21 for <notmuch@notmuchmail.org>; Thu, 2 May 2013 13:36:37 -0700 (PDT)
\r
22 Received: by mail-lb0-f174.google.com with SMTP id r10so948120lbi.19
\r
23 for <notmuch@notmuchmail.org>; Thu, 02 May 2013 13:36:35 -0700 (PDT)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=google.com; s=20120113;
\r
26 h=x-received:from:to:cc:subject:in-reply-to:references:user-agent
\r
27 :date:message-id:mime-version:content-type:x-gm-message-state;
\r
28 bh=XIVfDqkvQiwl6hpYlGTTItHZTCMS3k9GJKBfU1HDSL8=;
\r
29 b=c6Fln6JSh4cnTj0aAaqyFsf1DDIIrnsOV+29RnM/OY8JimRqZXMfka16ORdateZrBo
\r
30 hzzwGBhcJFR+p5TJp55Ufa4M9DJQU2ZTG8J2kjkFTSMbypbSLAuM2hEuE6MOciryca0z
\r
31 aPUnQklk/LDXx+ElaQ/kKXpaYuWyOBzYuP+OaE39pMIGpexrfSJ+Lv3/yoSu5MdC9klz
\r
32 Yrg/MsomPy5I2Px3x4/qU8Ckex3gZ+tODLGjlD/tmxrJgjnj4r9E7xmuZgHrXruwgsYZ
\r
33 BZm+6O0hzVh/YMHBAJtl6T/NhMJstBmqY2owMD5vKL8ZznFkftS08HHXf8bqOp3UeWeH
\r
35 X-Received: by 10.152.3.201 with SMTP id e9mr3140404lae.12.1367526995757;
\r
36 Thu, 02 May 2013 13:36:35 -0700 (PDT)
\r
37 Received: from localhost (dsl-hkibrasgw2-58c376-211.dhcp.inet.fi.
\r
39 by mx.google.com with ESMTPSA id x9sm3231397lbi.15.2013.05.02.13.36.33
\r
40 for <multiple recipients>
\r
41 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
42 Thu, 02 May 2013 13:36:34 -0700 (PDT)
\r
43 From: Jani Nikula <jani@nikula.org>
\r
44 To: Tomi Ollila <tomi.ollila@iki.fi>,
\r
45 Vladimir Marek <Vladimir.Marek@Oracle.COM>
\r
46 Subject: Re: [PATCH 01/24] lib/message.cc: stale pointer bug
\r
47 In-Reply-To: <m238u5tg2f.fsf@guru.guru-group.fi>
\r
48 References: <1367444021-2757-1-git-send-email-Vladimir.Marek@oracle.com>
\r
49 <m2sj25snsk.fsf@guru.guru-group.fi>
\r
50 <20130502134530.GB23259@pub.cz.oracle.com>
\r
51 <m238u5tg2f.fsf@guru.guru-group.fi>
\r
52 User-Agent: Notmuch/0.15.2+70~g2eeb96a (http://notmuchmail.org) Emacs/24.2.1
\r
53 (x86_64-pc-linux-gnu)
\r
54 Date: Thu, 02 May 2013 23:36:30 +0300
\r
55 Message-ID: <87mwsd3yr5.fsf@nikula.org>
\r
57 Content-Type: text/plain
\r
59 ALoCoQnq5i7/18+ftMJtrhyvPF0upCKVUz9xL12dnavccf2T09o+AQsTVRMYW13wzt+hvclalzXe
\r
60 Cc: notmuch@notmuchmail.org, Vladimir Marek <vlmarek@volny.cz>
\r
61 X-BeenThere: notmuch@notmuchmail.org
\r
62 X-Mailman-Version: 2.1.13
\r
64 List-Id: "Use and development of the notmuch mail system."
\r
65 <notmuch.notmuchmail.org>
\r
66 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
67 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
68 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
69 List-Post: <mailto:notmuch@notmuchmail.org>
\r
70 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
71 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
72 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
73 X-List-Received-Date: Thu, 02 May 2013 20:36:42 -0000
\r
75 On Thu, 02 May 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:
\r
76 > On Thu, May 02 2013, Vladimir Marek <Vladimir.Marek@Oracle.COM> wrote:
\r
78 >>> > int prefix_len = strlen (prefix);
\r
79 >>> > - const char *term = NULL;
\r
80 >>> > + std::string term;
\r
83 >>> > i.skip_to (prefix);
\r
85 >>> > - if (i != end)
\r
86 >>> > - term = (*i).c_str ();
\r
87 >>> > + if (i == end)
\r
88 >>> > + return NULL;
\r
90 >>> > - if (!term || strncmp (term, prefix, prefix_len))
\r
93 >>> ... hmm, a raii(?) solution above would be std::string term = *i;
\r
95 >> I'm not sure what's raii (I'm not very good at c++ ...), but I guess you
\r
96 >> mean to use 'std::string term = *i;' to avoid copy constructor. That
\r
97 >> surely is a good idea. Let me rework the patch!
\r
99 > I am not that smart (i.e. avoid copy constructor it might be, I don't
\r
100 > know...) I am lousy in c++. I attempter to mean
\r
101 > http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization
\r
102 > in a sense that when variable is introduced it is also initialized
\r
103 > to useful value (so that no-one accidentally add code between introduction
\r
104 > and initialization).
\r
106 > Anyway, if you rework the patch then we can vote which version to
\r
107 > apply (yeah, sure >;)
\r
109 I already dropped needs-review from the latest version [1]. I'm curious
\r
110 about patches 2-24, let's not stall here. ;)
\r
115 [1] id:1367505102-12860-1-git-send-email-Vladimir.Marek@oracle.com
\r