From: Carl Worth Date: Sun, 25 Oct 2009 05:04:59 +0000 (-0700) Subject: Trim down prefix list to things we are actually using. X-Git-Tag: 0.1~734 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f281f4b677e56242c18628683dcd4533906f7551;p=notmuch.git Trim down prefix list to things we are actually using. I've decided not to try for sup compatibility at the leve of the xapian datbase. There's just too much about sup's usage of the database that I don't like, (beyond the embedded ruby data structures there is redundant storage of message IDs, thread IDs, and dates (in both terms and values)). I'm going to fix that up in the database of notmuch, with some other changes as well. (I plan to drop "reference" terms once linkage to a thread ID through the reference is established. I also plan to add actual documents to represent threads.) So with all that incompatibility, I might as well make my own prefix values. And while doing that, I should try to be as compatible as possible with the conventions described here: http://xapian.org/docs/omega/termprefixes.html --- diff --git a/database.cc b/database.cc index 7a3019e1..c470cc34 100644 --- a/database.cc +++ b/database.cc @@ -41,25 +41,9 @@ typedef struct { const char *prefix; } prefix_t; -prefix_t NORMAL_PREFIX[] = { - { "subject", "S" }, - { "body", "B" }, - { "from_name", "FN" }, - { "to_name", "TN" }, - { "name", "N" }, - { "attachment", "A" } -}; - prefix_t BOOLEAN_PREFIX[] = { { "type", "K" }, - { "from_email", "FE" }, - { "to_email", "TE" }, - { "email", "E" }, - { "date", "D" }, - { "label", "L" }, { "tag", "L" }, - { "source_id", "I" }, - { "attachment_extension", "O" }, { "msgid", "Q" }, { "thread", "H" }, { "ref", "R" }, @@ -71,10 +55,6 @@ _find_prefix (const char *name) { unsigned int i; - for (i = 0; i < ARRAY_SIZE (NORMAL_PREFIX); i++) - if (strcmp (name, NORMAL_PREFIX[i].name) == 0) - return NORMAL_PREFIX[i].prefix; - for (i = 0; i < ARRAY_SIZE (BOOLEAN_PREFIX); i++) if (strcmp (name, BOOLEAN_PREFIX[i].name) == 0) return BOOLEAN_PREFIX[i].prefix;