aboutsummaryrefslogtreecommitdiffhomepage
path: root/database.cc
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-10-23 14:12:06 -0700
committerGravatar Carl Worth <cworth@cworth.org>2009-10-23 14:12:06 -0700
commitedbf7f645c1df17e45c189540207a77005347d83 (patch)
treed687a8c12bf5934aa8905197a41102aee686c198 /database.cc
parent9fc4a365d6cf478563caa012862c58a9b3945f76 (diff)
database: Similarly rename find_message_by_docid to find_document_for_doc_id
Again preferring notmuch_database_t* over Xapian::Database*. Also, we're standardizing on "doc_id" rather than "docid" locally, (as an analoge to "message_id"), in spite of the "Xapian::docid" name, (which, fortunately, we can ignore and just us "unsigned int" instead).
Diffstat (limited to 'database.cc')
-rw-r--r--database.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/database.cc b/database.cc
index 15d159ff..16c51459 100644
--- a/database.cc
+++ b/database.cc
@@ -92,10 +92,10 @@ find_doc_ids (notmuch_database_t *notmuch,
free (term);
}
-Xapian::Document
-find_message_by_docid (Xapian::Database *db, Xapian::docid docid)
+static Xapian::Document
+find_document_for_doc_id (notmuch_database_t *notmuch, unsigned doc_id)
{
- return db->get_document (docid);
+ return notmuch->xapian_db->get_document (doc_id);
}
static void
@@ -147,7 +147,6 @@ find_thread_ids (notmuch_database_t *notmuch,
GPtrArray *parents,
const char *message_id)
{
- Xapian::WritableDatabase *db = notmuch->xapian_db;
Xapian::PostingIterator child, children_end;
Xapian::Document doc;
GHashTable *thread_ids;
@@ -161,7 +160,7 @@ find_thread_ids (notmuch_database_t *notmuch,
find_doc_ids (notmuch, "ref", message_id, &child, &children_end);
for ( ; child != children_end; child++) {
- doc = find_message_by_docid (db, *child);
+ doc = find_document_for_doc_id (notmuch, *child);
insert_thread_id (thread_ids, doc);
}