mirror of
https://github.com/privacore/open-source-search-engine.git
synced 2025-07-15 02:36:08 -04:00
Move collExist logic out to a function
This commit is contained in:
12
Rdb.cpp
12
Rdb.cpp
@ -864,12 +864,8 @@ bool Rdb::dumpCollLoop ( ) {
|
||||
}
|
||||
|
||||
// before we create the file, see if tree has anything for this coll
|
||||
if(m_useTree) {
|
||||
if(!m_tree.collExists(m_dumpCollnum))
|
||||
continue;
|
||||
} else {
|
||||
if(!m_buckets.collExists(m_dumpCollnum))
|
||||
continue;
|
||||
if (!getTreeCollExist(m_dumpCollnum)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// . MDW ADDING A NEW FILE SHOULD BE IN RDBDUMP.CPP NOW... NO!
|
||||
@ -2100,6 +2096,10 @@ void Rdb::cleanTree() {
|
||||
else return m_buckets.cleanBuckets();
|
||||
}
|
||||
|
||||
bool Rdb::getTreeCollExist(collnum_t collnum) const {
|
||||
return (m_useTree ? m_tree.collExists(collnum) : m_buckets.collExists(collnum));
|
||||
}
|
||||
|
||||
// if we are doledb, we are a tree-only rdb, so try to reclaim
|
||||
// memory from deleted nodes. works by condensing the used memory.
|
||||
// returns how much we reclaimed.
|
||||
|
2
Rdb.h
2
Rdb.h
@ -235,6 +235,8 @@ private:
|
||||
// returns false if no room in tree or m_mem for a list to add
|
||||
bool hasRoom(RdbList *list);
|
||||
|
||||
bool getTreeCollExist(collnum_t collnum) const;
|
||||
|
||||
bool addList(collnum_t collnum, RdbList *list, bool checkForRoom);
|
||||
// get the directory name where this rdb stores its files
|
||||
const char *getDir() const { return g_hostdb.m_dir; }
|
||||
|
Reference in New Issue
Block a user