From f281f4b677e56242c18628683dcd4533906f7551 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 24 Oct 2009 22:04:59 -0700 Subject: [PATCH] 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 --- database.cc | 20 -------------------- 1 file changed, 20 deletions(-) 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; -- 2.43.0