From 645af1aa55a9932ac6a281e0dc520b028f4c768b Mon Sep 17 00:00:00 2001 From: dockes Date: Tue, 10 Nov 2009 17:32:13 +0000 Subject: [PATCH] removed the useless keep_updated flag --- src/rcldb/rcldb.cpp | 18 ++++++++++-------- src/rcldb/rcldb.h | 4 ++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/rcldb/rcldb.cpp b/src/rcldb/rcldb.cpp index d0d68f23..e844c652 100644 --- a/src/rcldb/rcldb.cpp +++ b/src/rcldb/rcldb.cpp @@ -512,7 +512,7 @@ list Db::getStemmerNames() return res; } -bool Db::open(OpenMode mode, bool keep_updated) +bool Db::open(OpenMode mode) { if (m_ndb == 0 || m_config == 0) { m_reason = "Null configuration or Xapian Db"; @@ -547,12 +547,10 @@ bool Db::open(OpenMode mode, bool keep_updated) m_ndb->xrdb = Xapian::Database(dir); LOGDEB(("Db::open: lastdocid: %d\n", m_ndb->xwdb.get_lastdocid())); - if (!keep_updated) { - LOGDEB2(("Db::open: resetting updated\n")); - updated.resize(m_ndb->xwdb.get_lastdocid() + 1); - for (unsigned int i = 0; i < updated.size(); i++) - updated[i] = false; - } + LOGDEB2(("Db::open: resetting updated\n")); + updated.resize(m_ndb->xwdb.get_lastdocid() + 1); + for (unsigned int i = 0; i < updated.size(); i++) + updated[i] = false; } break; case DbRO: @@ -640,10 +638,14 @@ bool Db::i_close(bool final) // Reopen the db with a changed list of additional dbs bool Db::adjustdbs() { + if (m_mode != DbRO) { + LOGERR(("Db::adjustdbs: mode not RO\n")); + return false; + } if (m_ndb && m_ndb->m_isopen) { if (!close()) return false; - if (!open(m_mode, true)) { + if (!open(m_mode)) { return false; } } diff --git a/src/rcldb/rcldb.h b/src/rcldb/rcldb.h index d4ad8051..bd7c1cc3 100644 --- a/src/rcldb/rcldb.h +++ b/src/rcldb/rcldb.h @@ -44,7 +44,7 @@ using std::vector; // user interface. In other words, this is not exhaustive or well-designed or // reusable. // -// Unique Document Identifier: unically identifies a document in its +// Unique Document Identifier: uniquely identifies a document in its // source storage (file system or other). Used for up to date checks // etc. "udi". Our user is responsible for making sure it's not too // big, cause it's stored as a Xapian term (< 150 bytes would be @@ -86,7 +86,7 @@ class Db { ~Db(); enum OpenMode {DbRO, DbUpd, DbTrunc}; - bool open(OpenMode mode, bool keep_updated = false); + bool open(OpenMode mode); bool close(); bool isopen();