mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02: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:
parent
c63364610f
commit
680bc2cbb3
13 changed files with 74 additions and 74 deletions
|
|
@ -390,9 +390,9 @@ int CAddrMan::Check_()
|
|||
if (vRandom.size() != nTried + nNew)
|
||||
return -7;
|
||||
|
||||
for (std::map<int, CAddrInfo>::iterator it = mapInfo.begin(); it != mapInfo.end(); it++) {
|
||||
int n = (*it).first;
|
||||
CAddrInfo& info = (*it).second;
|
||||
for (const auto& entry : mapInfo) {
|
||||
int n = entry.first;
|
||||
const CAddrInfo& info = entry.second;
|
||||
if (info.fInTried) {
|
||||
if (!info.nLastSuccess)
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue