diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-01-30 13:13:07 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-01-30 13:13:20 +0100 |
commit | 668de70be039a4f1ffcf20aeae2a22ee71fc55a8 (patch) | |
tree | e6baaf60d95d75452af3ebacd57da5479d4a3ebd /src/txdb.cpp | |
parent | 36966a1c0e6415964008c679c1a01d9883486e87 (diff) | |
parent | b7b48c8bbdf7a90861610b035d8b0a247ef78c45 (diff) |
Merge #9644: [refactor] Remove using namespace <xxx> from src/
b7b48c8 Refactor: Remove using namespace <xxx> from src/*.cpp. (Karl-Johan Alm)
Diffstat (limited to 'src/txdb.cpp')
-rw-r--r-- | src/txdb.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/txdb.cpp b/src/txdb.cpp index c223abd590..1a30bb58ad 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -14,8 +14,6 @@ #include <boost/thread.hpp> -using namespace std; - static const char DB_COINS = 'c'; static const char DB_BLOCK_FILES = 'f'; static const char DB_TXINDEX = 't'; @@ -32,11 +30,11 @@ CCoinsViewDB::CCoinsViewDB(size_t nCacheSize, bool fMemory, bool fWipe) : db(Get } bool CCoinsViewDB::GetCoins(const uint256 &txid, CCoins &coins) const { - return db.Read(make_pair(DB_COINS, txid), coins); + return db.Read(std::make_pair(DB_COINS, txid), coins); } bool CCoinsViewDB::HaveCoins(const uint256 &txid) const { - return db.Exists(make_pair(DB_COINS, txid)); + return db.Exists(std::make_pair(DB_COINS, txid)); } uint256 CCoinsViewDB::GetBestBlock() const { @@ -53,9 +51,9 @@ bool CCoinsViewDB::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end();) { if (it->second.flags & CCoinsCacheEntry::DIRTY) { if (it->second.coins.IsPruned()) - batch.Erase(make_pair(DB_COINS, it->first)); + batch.Erase(std::make_pair(DB_COINS, it->first)); else - batch.Write(make_pair(DB_COINS, it->first), it->second.coins); + batch.Write(std::make_pair(DB_COINS, it->first), it->second.coins); changed++; } count++; @@ -73,7 +71,7 @@ CBlockTreeDB::CBlockTreeDB(size_t nCacheSize, bool fMemory, bool fWipe) : CDBWra } bool CBlockTreeDB::ReadBlockFileInfo(int nFile, CBlockFileInfo &info) { - return Read(make_pair(DB_BLOCK_FILES, nFile), info); + return Read(std::make_pair(DB_BLOCK_FILES, nFile), info); } bool CBlockTreeDB::WriteReindexing(bool fReindexing) { @@ -139,23 +137,23 @@ void CCoinsViewDBCursor::Next() bool CBlockTreeDB::WriteBatchSync(const std::vector<std::pair<int, const CBlockFileInfo*> >& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo) { CDBBatch batch(*this); for (std::vector<std::pair<int, const CBlockFileInfo*> >::const_iterator it=fileInfo.begin(); it != fileInfo.end(); it++) { - batch.Write(make_pair(DB_BLOCK_FILES, it->first), *it->second); + batch.Write(std::make_pair(DB_BLOCK_FILES, it->first), *it->second); } batch.Write(DB_LAST_BLOCK, nLastFile); for (std::vector<const CBlockIndex*>::const_iterator it=blockinfo.begin(); it != blockinfo.end(); it++) { - batch.Write(make_pair(DB_BLOCK_INDEX, (*it)->GetBlockHash()), CDiskBlockIndex(*it)); + batch.Write(std::make_pair(DB_BLOCK_INDEX, (*it)->GetBlockHash()), CDiskBlockIndex(*it)); } return WriteBatch(batch, true); } bool CBlockTreeDB::ReadTxIndex(const uint256 &txid, CDiskTxPos &pos) { - return Read(make_pair(DB_TXINDEX, txid), pos); + return Read(std::make_pair(DB_TXINDEX, txid), pos); } bool CBlockTreeDB::WriteTxIndex(const std::vector<std::pair<uint256, CDiskTxPos> >&vect) { CDBBatch batch(*this); for (std::vector<std::pair<uint256,CDiskTxPos> >::const_iterator it=vect.begin(); it!=vect.end(); it++) - batch.Write(make_pair(DB_TXINDEX, it->first), it->second); + batch.Write(std::make_pair(DB_TXINDEX, it->first), it->second); return WriteBatch(batch); } @@ -175,7 +173,7 @@ bool CBlockTreeDB::LoadBlockIndexGuts(boost::function<CBlockIndex*(const uint256 { std::unique_ptr<CDBIterator> pcursor(NewIterator()); - pcursor->Seek(make_pair(DB_BLOCK_INDEX, uint256())); + pcursor->Seek(std::make_pair(DB_BLOCK_INDEX, uint256())); // Load mapBlockIndex while (pcursor->Valid()) { |