mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-24 22:45:41 +01:00
Use range-based for loops (C++11) when looping over map elements
Before this commit:
for (std::map<T1, T2>::iterator x = y.begin(); x != y.end(); ++x) {
}
After this commit:
for (auto& x : y) {
}
This commit is contained in:
@@ -80,10 +80,10 @@ public:
|
||||
cachedWallet.clear();
|
||||
{
|
||||
LOCK2(cs_main, wallet->cs_wallet);
|
||||
for(std::map<uint256, CWalletTx>::iterator it = wallet->mapWallet.begin(); it != wallet->mapWallet.end(); ++it)
|
||||
for (const auto& entry : wallet->mapWallet)
|
||||
{
|
||||
if(TransactionRecord::showTransaction(it->second))
|
||||
cachedWallet.append(TransactionRecord::decomposeTransaction(wallet, it->second));
|
||||
if (TransactionRecord::showTransaction(entry.second))
|
||||
cachedWallet.append(TransactionRecord::decomposeTransaction(wallet, entry.second));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user