mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
database: Rename internal find_messages_by_term to find_doc_ids
This name is a more accurate description of what it does, and the more general naming will make sense as we start storing non-message documents in the database (such as directory timestamps). Also, don't pass around a Xapian::Database where it's more our style to pass a notmuch_database_t*.
This commit is contained in:
parent
6b228e4509
commit
9fc4a365d6
1 changed files with 9 additions and 11 deletions
20
database.cc
20
database.cc
|
@ -74,21 +74,20 @@ add_term (Xapian::Document doc,
|
|||
}
|
||||
|
||||
static void
|
||||
find_messages_by_term (Xapian::Database *db,
|
||||
const char *prefix_name,
|
||||
const char *value,
|
||||
Xapian::PostingIterator *begin,
|
||||
Xapian::PostingIterator *end)
|
||||
find_doc_ids (notmuch_database_t *notmuch,
|
||||
const char *prefix_name,
|
||||
const char *value,
|
||||
Xapian::PostingIterator *begin,
|
||||
Xapian::PostingIterator *end)
|
||||
{
|
||||
Xapian::PostingIterator i;
|
||||
char *term;
|
||||
|
||||
term = g_strdup_printf ("%s%s", _find_prefix (prefix_name), value);
|
||||
|
||||
*begin = db->postlist_begin (term);
|
||||
*begin = notmuch->xapian_db->postlist_begin (term);
|
||||
|
||||
if (end)
|
||||
*end = db->postlist_end (term);
|
||||
*end = notmuch->xapian_db->postlist_end (term);
|
||||
|
||||
free (term);
|
||||
}
|
||||
|
@ -128,8 +127,7 @@ notmuch_database_find_message (notmuch_database_t *notmuch,
|
|||
{
|
||||
Xapian::PostingIterator i, end;
|
||||
|
||||
find_messages_by_term (notmuch->xapian_db,
|
||||
"msgid", message_id, &i, &end);
|
||||
find_doc_ids (notmuch, "msgid", message_id, &i, &end);
|
||||
|
||||
if (i == end)
|
||||
return NULL;
|
||||
|
@ -161,7 +159,7 @@ find_thread_ids (notmuch_database_t *notmuch,
|
|||
thread_ids = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
free, NULL);
|
||||
|
||||
find_messages_by_term (db, "ref", message_id, &child, &children_end);
|
||||
find_doc_ids (notmuch, "ref", message_id, &child, &children_end);
|
||||
for ( ; child != children_end; child++) {
|
||||
doc = find_message_by_docid (db, *child);
|
||||
insert_thread_id (thread_ids, doc);
|
||||
|
|
Loading…
Reference in a new issue