Mark LevelDB "Read" and "Exists" functions as const.
Mark the "Read" and "Exists" functions in CLevelDBWrapper as "const". They do not change anything in the DB, by definition.
This commit is contained in:
parent
0d763fc9e1
commit
ffb4c210bc
@ -82,7 +82,7 @@ public:
|
|||||||
CLevelDBWrapper(const boost::filesystem::path &path, size_t nCacheSize, bool fMemory = false, bool fWipe = false);
|
CLevelDBWrapper(const boost::filesystem::path &path, size_t nCacheSize, bool fMemory = false, bool fWipe = false);
|
||||||
~CLevelDBWrapper();
|
~CLevelDBWrapper();
|
||||||
|
|
||||||
template<typename K, typename V> bool Read(const K& key, V& value) throw(leveldb_error) {
|
template<typename K, typename V> bool Read(const K& key, V& value) const throw(leveldb_error) {
|
||||||
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
|
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
|
||||||
ssKey.reserve(ssKey.GetSerializeSize(key));
|
ssKey.reserve(ssKey.GetSerializeSize(key));
|
||||||
ssKey << key;
|
ssKey << key;
|
||||||
@ -111,7 +111,7 @@ public:
|
|||||||
return WriteBatch(batch, fSync);
|
return WriteBatch(batch, fSync);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename K> bool Exists(const K& key) throw(leveldb_error) {
|
template<typename K> bool Exists(const K& key) const throw(leveldb_error) {
|
||||||
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
|
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
|
||||||
ssKey.reserve(ssKey.GetSerializeSize(key));
|
ssKey.reserve(ssKey.GetSerializeSize(key));
|
||||||
ssKey << key;
|
ssKey << key;
|
||||||
|
Loading…
Reference in New Issue
Block a user