mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-13 14:14:00 +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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user