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 4C48E431FC0; Fri, 27 Nov 2009 04:47:09 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org 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 hv+HRavk5zwV; Fri, 27 Nov 2009 04:47:08 -0800 (PST) Received: from cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 3DD3A431FAE; Fri, 27 Nov 2009 04:47:08 -0800 (PST) From: Carl Worth To: Keith Packard , notmuch@notmuchmail.org In-Reply-To: References: Date: Fri, 27 Nov 2009 04:46:54 -0800 Message-ID: <87iqcwqgn5.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [notmuch] _notmuch_message_create_for_message_id makes extra call to notmuch_database_find_message X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 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, 27 Nov 2009 12:47:09 -0000 On Mon, 23 Nov 2009 12:29:44 -0800, Keith Packard wrote: > > Looking at _notmuch_message_create_for_message_id, the first thing it > does is call notmuch_database_find_message, but the returned 'message' > is never used. I haven't tried, but I suspect this call could just be > removed. Did the "if" statement immediately afterwards just look like error checking? It's not: message = notmuch_database_find_message (notmuch, message_id); if (message) return talloc_steal (notmuch, message); That's "if there's a message is in the database with this message-id, return it straight away". Or am I looking at the wrong bit of code? -Carl