Skip to content

Commit e030240

Browse files
committed
refactor: inline constant return value of CDBWrapper::Erase and BlockTreeDB::WriteReindexing
Did both in this commit, since the return value of `WriteReindexing` was ignored anyway - which existed only because of the constant `Erase` being called
1 parent cdab948 commit e030240

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/dbwrapper.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,11 @@ class CDBWrapper
255255
}
256256

257257
template <typename K>
258-
bool Erase(const K& key, bool fSync = false)
258+
void Erase(const K& key, bool fSync = false)
259259
{
260260
CDBBatch batch(*this);
261261
batch.Erase(key);
262262
WriteBatch(batch, fSync);
263-
return true;
264263
}
265264

266265
void WriteBatch(CDBBatch& batch, bool fSync = false);

src/node/blockstorage.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,12 @@ bool BlockTreeDB::ReadBlockFileInfo(int nFile, CBlockFileInfo& info)
5959
return Read(std::make_pair(DB_BLOCK_FILES, nFile), info);
6060
}
6161

62-
bool BlockTreeDB::WriteReindexing(bool fReindexing)
62+
void BlockTreeDB::WriteReindexing(bool fReindexing)
6363
{
6464
if (fReindexing) {
6565
Write(DB_REINDEX_FLAG, uint8_t{'1'});
66-
return true;
6766
} else {
68-
return Erase(DB_REINDEX_FLAG);
67+
Erase(DB_REINDEX_FLAG);
6968
}
7069
}
7170

src/node/blockstorage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class BlockTreeDB : public CDBWrapper
5555
bool WriteBatchSync(const std::vector<std::pair<int, const CBlockFileInfo*>>& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo);
5656
bool ReadBlockFileInfo(int nFile, CBlockFileInfo& info);
5757
bool ReadLastBlockFile(int& nFile);
58-
bool WriteReindexing(bool fReindexing);
58+
void WriteReindexing(bool fReindexing);
5959
void ReadReindexing(bool& fReindexing);
6060
bool WriteFlag(const std::string& name, bool fValue);
6161
bool ReadFlag(const std::string& name, bool& fValue);

0 commit comments

Comments
 (0)