From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 1866D6DE17AA for ; Sun, 30 Aug 2015 04:48:46 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.117 X-Spam-Level: X-Spam-Status: No, score=0.117 tagged_above=-999 required=5 tests=[AWL=0.117] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NgB_06bLHupY for ; Sun, 30 Aug 2015 04:48:44 -0700 (PDT) Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224]) by arlo.cworth.org (Postfix) with ESMTPS id EFE3E6DE1642 for ; Sun, 30 Aug 2015 04:48:43 -0700 (PDT) Received: from remotemail by gitolite.debian.net with local (Exim 4.80) (envelope-from ) id 1ZW14a-0007D2-Fk; Sun, 30 Aug 2015 11:46:56 +0000 Received: (nullmailer pid 15097 invoked by uid 1000); Sun, 30 Aug 2015 11:46:35 -0000 From: David Bremner To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: [RFC PATCH 4/5] cli: change the data structure for notmuch address deduplication In-Reply-To: <87h9nh1aol.fsf@nikula.org> References: <87a8t9tuka.fsf@maritornes.cs.unb.ca> <87h9nh1aol.fsf@nikula.org> User-Agent: Notmuch/0.20.2+60~gcb08a2e (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Sun, 30 Aug 2015 08:46:35 -0300 Message-ID: <877fodt2w4.fsf@maritornes.cs.unb.ca> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.18 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: Sun, 30 Aug 2015 11:48:46 -0000 Jani Nikula writes: >> I found this use of mailbox as a temporary variable confusing; despite >> the obvious return I thought it might have something to do with the >> g_list_append below. Maybe just make a block scope temporary variable? > > This is how the function would turn out with that. Better, I guess? I > also tried to think of ways to combine the two g_list_append paths here, > but in the end doing it like this has most clarity I think. > Your (new) version is fine for me. As it happens I was thinking of a smaller tweak: l = g_list_find_custom (list, mailbox, mailbox_compare); if (l) { mailbox_t *found; talloc_free (mailbox); found = l->data; found->count++; return TRUE; }