diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-11-30 17:09:44 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-11-30 17:10:05 -0500 |
commit | fbce66a982679b5409a295be5c99a2eef429cabf (patch) | |
tree | 11dc4d7ceddd2b7370c5eb8bdfe8197adbf0f663 /src/qt | |
parent | 9e38d357447eb8bcc17d4438bc9f4f3a34fac308 (diff) | |
parent | 680bc2cbb34d6bedd0e64b17d0555216572be4c8 (diff) |
Merge #10493: Use range-based for loops (C++11) when looping over map elements
680bc2cbb Use range-based for loops (C++11) when looping over map elements (practicalswift)
Pull request description:
Before this commit:
```c++
for (std::map<T1, T2>::iterator x = y.begin(); x != y.end(); ++x) {
T1 z = (*x).first;
…
}
```
After this commit:
```c++
for (auto& x : y) {
T1 z = x.first;
…
}
```
Tree-SHA512: 954b136b7f5e6df09f39248a6b530fd9baa9ab59d7c2c7eb369fd4afbb591b7a52c92ee25f87f1745f47b41d6828b7abfd395b43daf84a55b4e6a3d45015e3a0
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/bantablemodel.cpp | 6 | ||||
-rw-r--r-- | src/qt/transactiontablemodel.cpp | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/qt/bantablemodel.cpp b/src/qt/bantablemodel.cpp index 84807da65d..c96bdfd5d7 100644 --- a/src/qt/bantablemodel.cpp +++ b/src/qt/bantablemodel.cpp @@ -55,11 +55,11 @@ public: #if QT_VERSION >= 0x040700 cachedBanlist.reserve(banMap.size()); #endif - for (banmap_t::iterator it = banMap.begin(); it != banMap.end(); it++) + for (const auto& entry : banMap) { CCombinedBan banEntry; - banEntry.subnet = (*it).first; - banEntry.banEntry = (*it).second; + banEntry.subnet = entry.first; + banEntry.banEntry = entry.second; cachedBanlist.append(banEntry); } diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index cc0dc5ef48..67580f11ae 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -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)); } } } |