Don't hash headers we won't end up using.
authorCarl Worth <cworth@cworth.org>
Mon, 19 Oct 2009 20:48:13 +0000 (13:48 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 19 Oct 2009 20:48:13 +0000 (13:48 -0700)
Just saving a little work here.

database.cc
message.c

index 2f3959fa5f6a3a28168c0738545df2b8ce97cacd..efc3876205b79de6469373533988af12ca6f354e 100644 (file)
@@ -486,6 +486,13 @@ notmuch_database_add_message (notmuch_database_t *notmuch,
 
     message = notmuch_message_open (filename);
 
+    notmuch_message_restrict_headers (message,
+                                     "references",
+                                     "in-reply-to",
+                                     "message-id",
+                                     "date",
+                                     (char *) NULL);
+
     try {
        doc = Xapian::Document ();
 
index 646403fb6fb198417766b76920e9ee1bfd65232b..97df4b270fefe344577ae32f24c7bc51331a0499 100644 (file)
--- a/message.c
+++ b/message.c
@@ -241,7 +241,7 @@ notmuch_message_get_header (notmuch_message_t *message,
     contains = g_hash_table_lookup_extended (message->headers,
                                             header_desired, NULL,
                                             (gpointer *) &value);
-    if (contains)
+    if (contains && value)
        return value;
 
     if (message->parsing_finished)