unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* _notmuch_message_create_for_message_id makes extra call to notmuch_database_find_message
@ 2009-11-23 20:29 Keith Packard
  2009-11-27 12:46 ` Carl Worth
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Packard @ 2009-11-23 20:29 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]


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.

-- 
keith.packard@intel.com

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: _notmuch_message_create_for_message_id makes extra call to notmuch_database_find_message
  2009-11-23 20:29 _notmuch_message_create_for_message_id makes extra call to notmuch_database_find_message Keith Packard
@ 2009-11-27 12:46 ` Carl Worth
  2009-11-27 18:10   ` Keith Packard
  0 siblings, 1 reply; 3+ messages in thread
From: Carl Worth @ 2009-11-27 12:46 UTC (permalink / raw)
  To: Keith Packard, notmuch

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: _notmuch_message_create_for_message_id makes extra call to notmuch_database_find_message
  2009-11-27 12:46 ` Carl Worth
@ 2009-11-27 18:10   ` Keith Packard
  0 siblings, 0 replies; 3+ messages in thread
From: Keith Packard @ 2009-11-27 18:10 UTC (permalink / raw)
  To: Carl Worth, notmuch

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

On Fri, 27 Nov 2009 04:46:54 -0800, Carl Worth <cworth@cworth.org> wrote:

> Did the "if" statement immediately afterwards just look like error
> checking? It's not:

Yes, it did (I think my brain may have auto-inserted a '!' there).

Ok, having read the code a bit more carefully, this does look correct.

I have to say that _notmuch_message_create is a bit of a tricky name; as
it doesn't create a message so much as load a message from the database.

-- 
keith.packard@intel.com

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-27 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-23 20:29 _notmuch_message_create_for_message_id makes extra call to notmuch_database_find_message Keith Packard
2009-11-27 12:46 ` Carl Worth
2009-11-27 18:10   ` Keith Packard

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).