Re: [notmuch] _notmuch_message_create_for_message_id makes extra call to notmuch_database_find_message

Subject: Re: [notmuch] _notmuch_message_create_for_message_id makes extra call to notmuch_database_find_message

Date: Fri, 27 Nov 2009 04:46:54 -0800

To: Keith Packard, notmuch@notmuchmail.org

Cc:

From: Carl Worth


On Mon, 23 Nov 2009 12:29:44 -0800, Keith Packard <keithp@keithp.com> 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

Thread: