diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2017-06-13 17:55:46 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2017-06-13 18:05:58 -0700 |
commit | 1ad3d4e1261f4a444d982a1470c257c78233bda3 (patch) | |
tree | 228e740c5251770dc6f32a99c8be792b1ea5eda8 /src/init.cpp | |
parent | fbf5d3ba15161f71cbb84a51c1703c22b651e8a9 (diff) | |
parent | 1238f13cf6ccf1177b66df735f360c61ae1dc20b (diff) |
Merge #10502: scripted-diff: Remove BOOST_FOREACH, Q_FOREACH and PAIRTYPE
1238f13cf scripted-diff: Remove PAIRTYPE (Jorge Timón)
18dc3c396 scripted-diff: Remove Q_FOREACH (Jorge Timón)
7c00c2672 scripted-diff: Fully remove BOOST_FOREACH (Jorge Timón)
a5410ac5e Small preparations for Q_FOREACH, PAIRTYPE and #include <boost/foreach.hpp> removal (Jorge Timón)
Tree-SHA512: d3ab4a173366402e7dcef31608977b757d4aa07abbbad2ee1bcbcfa311e994a4552f24e5a55272cb22c2dcf89a4b0495e02e9d9aceae4b08c0bab668f20e324c
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/init.cpp b/src/init.cpp index 56d0bd9b0e..b6e4cd06f6 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -613,7 +613,7 @@ void CleanupBlockRevFiles() // keeping a separate counter. Once we hit a gap (or if 0 doesn't exist) // start removing block files. int nContigCounter = 0; - BOOST_FOREACH(const PAIRTYPE(std::string, fs::path)& item, mapBlockFiles) { + for (const std::pair<std::string, fs::path>& item : mapBlockFiles) { if (atoi(item.first) == nContigCounter) { nContigCounter++; continue; @@ -666,7 +666,7 @@ void ThreadImport(std::vector<fs::path> vImportFiles) } // -loadblock= - BOOST_FOREACH(const fs::path& path, vImportFiles) { + for (const fs::path& path : vImportFiles) { FILE *file = fsbridge::fopen(path, "rb"); if (file) { LogPrintf("Importing blocks file %s...\n", path.string()); @@ -1260,7 +1260,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) // sanitize comments per BIP-0014, format user agent and check total size std::vector<std::string> uacomments; if (gArgs.IsArgSet("-uacomment")) { - BOOST_FOREACH(std::string cmt, gArgs.GetArgs("-uacomment")) + for (std::string cmt : gArgs.GetArgs("-uacomment")) { if (cmt != SanitizeString(cmt, SAFE_CHARS_UA_COMMENT)) return InitError(strprintf(_("User Agent comment (%s) contains unsafe characters."), cmt)); @@ -1275,7 +1275,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) if (gArgs.IsArgSet("-onlynet")) { std::set<enum Network> nets; - BOOST_FOREACH(const std::string& snet, gArgs.GetArgs("-onlynet")) { + for (const std::string& snet : gArgs.GetArgs("-onlynet")) { enum Network net = ParseNetwork(snet); if (net == NET_UNROUTABLE) return InitError(strprintf(_("Unknown network specified in -onlynet: '%s'"), snet)); @@ -1289,7 +1289,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) } if (gArgs.IsArgSet("-whitelist")) { - BOOST_FOREACH(const std::string& net, gArgs.GetArgs("-whitelist")) { + for (const std::string& net : gArgs.GetArgs("-whitelist")) { CSubNet subnet; LookupSubNet(net.c_str(), subnet); if (!subnet.IsValid()) @@ -1351,7 +1351,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) if (fListen) { bool fBound = false; if (gArgs.IsArgSet("-bind")) { - BOOST_FOREACH(const std::string& strBind, gArgs.GetArgs("-bind")) { + for (const std::string& strBind : gArgs.GetArgs("-bind")) { CService addrBind; if (!Lookup(strBind.c_str(), addrBind, GetListenPort(), false)) return InitError(ResolveErrMsg("bind", strBind)); @@ -1359,7 +1359,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) } } if (gArgs.IsArgSet("-whitebind")) { - BOOST_FOREACH(const std::string& strBind, gArgs.GetArgs("-whitebind")) { + for (const std::string& strBind : gArgs.GetArgs("-whitebind")) { CService addrBind; if (!Lookup(strBind.c_str(), addrBind, 0, false)) return InitError(ResolveErrMsg("whitebind", strBind)); @@ -1379,7 +1379,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) } if (gArgs.IsArgSet("-externalip")) { - BOOST_FOREACH(const std::string& strAddr, gArgs.GetArgs("-externalip")) { + for (const std::string& strAddr : gArgs.GetArgs("-externalip")) { CService addrLocal; if (Lookup(strAddr.c_str(), addrLocal, GetListenPort(), fNameLookup) && addrLocal.IsValid()) AddLocal(addrLocal, LOCAL_MANUAL); @@ -1618,7 +1618,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) std::vector<fs::path> vImportFiles; if (gArgs.IsArgSet("-loadblock")) { - BOOST_FOREACH(const std::string& strFile, gArgs.GetArgs("-loadblock")) + for (const std::string& strFile : gArgs.GetArgs("-loadblock")) vImportFiles.push_back(strFile); } |