Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 29ED4429E25 for ; Fri, 9 Dec 2011 07:55:46 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tys+7oCJkeaq for ; Fri, 9 Dec 2011 07:55:45 -0800 (PST) Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU [18.9.25.13]) by olra.theworths.org (Postfix) with ESMTP id A5FD5431FB6 for ; Fri, 9 Dec 2011 07:55:45 -0800 (PST) X-AuditID: 1209190d-b7f726d0000008d1-dc-4ee22f80bb7a Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP id D7.6D.02257.08F22EE4; Fri, 9 Dec 2011 10:55:44 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id pB9FthHX031297; Fri, 9 Dec 2011 10:55:43 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id pB9Fte0s014236 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Fri, 9 Dec 2011 10:55:41 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1RZ2p7-0008PQ-7a; Fri, 09 Dec 2011 10:57:21 -0500 Date: Fri, 9 Dec 2011 10:57:21 -0500 From: Austin Clements To: Tomi Ollila Subject: Re: [Patch 1/2] separate handling when addresses == NULL Message-ID: <20111209155704.GE3190@mit.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IR4hTV1m3Qf+Rn0LqCx+L6zZnMFm9WzmN1 YPI4/HUhi8ezVbeYA5iiuGxSUnMyy1KL9O0SuDJe/08umM9Z0bzoD2MD4zz2LkZODgkBE4mz u7exQNhiEhfurWfrYuTiEBLYxyixo/EEM4SznlGi59UxFgjnBJPEnH+boTJLGCX+nPnOCNLP IqAi8XLhP7BZbAIaEtv2LweLiwDFH7StZwWxmQWkJb79bmbqYuTgEBZwlFh/vRgkzCugLXH/ +nmwViGBfIk5T9cyQcQFJU7OfMIC0aolcePfS7BWkDHL/3GAhDkFdCTmr9wLNl0UaNOUk9vY JjAKzULSPQtJ9yyE7gWMzKsYZVNyq3RzEzNzilOTdYuTE/PyUot0jfRyM0v0UlNKNzGCg1qS dwfju4NKhxgFOBiVeHgf8D70E2JNLCuuzD3EKMnBpCTKu1P3kZ8QX1J+SmVGYnFGfFFpTmrx IUYJDmYlEV4VeaAcb0piZVVqUT5MSpqDRUmct2YX0CSB9MSS1OzU1ILUIpisDAeHkgTvZj2g RsGi1PTUirTMnBKENBMHJ8hwHqDhq0BqeIsLEnOLM9Mh8qcYFaXEeY+CJARAEhmleXC9sKTz ilEc6BVh3vUgVTzAhAXX/QpoMBPQ4C/ZD0AGlyQipKQaGLOOaC4w2tJ/wvWHyVSvc0lr4xuW HTunLnQ2S2Kh/LXjX1+ZbZ17tO7I+2+BRUfn+au1aMxfnbBIb4vUqqds+jr39568YHFZ9luQ jv8S0yVG9bbGqkubfspvVZjnr1CdODHv4pOAaoOS4wlNCzY5sN88lrn4wy7rhvm7A7YVGu9e 96pGnWGF+2wlluKMREMt5qLiRAC1+ibkFQMAAA== Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2011 15:55:46 -0000 Quoth Tomi Ollila on Dec 09 at 3:52 pm: > When addresses is NULL, (future) addresses object cleanup is not needed. > --- > notmuch-show.c | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/notmuch-show.c b/notmuch-show.c > index 603992a..c27ef6a 100644 > --- a/notmuch-show.c > +++ b/notmuch-show.c > @@ -239,7 +239,11 @@ _extract_email_address (const void *ctx, const char *from) > addresses = internet_address_list_parse_string (from); > > /* Bail if there is no address here. */ > - if (addresses == NULL || internet_address_list_length (addresses) < 1) > + if (addresses == NULL) > + return email; > + > + /* Bail if there is no address here. */ > + if (internet_address_list_length (addresses) < 1) > goto DONE; Personally, I would much prefer to see the code as it was---with the sometimes unnecessary goto DONE---and an if (addresses) around the later cleanup that the second patch adds. It's more maintainable in case someone ever adds more code earlier in this function and this microoptimization isn't buying you anything. > > /* Otherwise, just use the first address. */