From 680bc2cbb34d6bedd0e64b17d0555216572be4c8 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Sun, 4 Jun 2017 22:02:43 +0200 Subject: Use range-based for loops (C++11) when looping over map elements Before this commit: for (std::map::iterator x = y.begin(); x != y.end(); ++x) { } After this commit: for (auto& x : y) { } --- src/qt/bantablemodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/qt/bantablemodel.cpp') diff --git a/src/qt/bantablemodel.cpp b/src/qt/bantablemodel.cpp index f8a99506c1..90e1eed9a2 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); } -- cgit v1.2.3