X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Futil.cpp;h=b1e1607b83947ff660fb936c8251fdbc8bf010aa;hp=76eb8a5755512f6f67419de4d0637f58e2a9b740;hb=5098ea454db9132aa0f576921ca9d1a69429d146;hpb=47d3ceb3da845e216fc9577cbf52f8b5600e5f93 diff --git a/src/util.cpp b/src/util.cpp index 76eb8a5..b1e1607 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -7,6 +7,7 @@ #include "sync.h" #include "version.h" #include "interface.h" + #include #include // for to_lower() #include // for startswith() and endswith() @@ -14,9 +15,7 @@ #include #include #include - #include -#include #include #include #include @@ -451,7 +450,7 @@ static const signed char phexdigit[256] = bool IsHex(const string& str) { - BOOST_FOREACH(unsigned char c, str) + for (unsigned char c : str) { if (phexdigit[c] < 0) return false; @@ -527,7 +526,7 @@ void ParseParameters(int argc, const char* const argv[]) } // New 0.6 features: - BOOST_FOREACH(const PAIRTYPE(string,string)& entry, mapArgs) + for (const auto& entry : mapArgs) { string name = entry.first; @@ -952,7 +951,7 @@ std::string EncodeDumpTime(int64_t nTime) { std::string EncodeDumpString(const std::string &str) { std::stringstream ret; - BOOST_FOREACH(unsigned char c, str) { + for (unsigned char c : str) { if (c <= 32 || c >= 128 || c == '%') { ret << '%' << HexStr(&c, &c + 1); } else { @@ -1358,7 +1357,7 @@ void AddTimeData(const CNetAddr& ip, int64_t nTime) bool fMatch = false; // If nobody has a time different than ours but within 5 minutes of ours, give a warning - BOOST_FOREACH(int64_t nOffset, vSorted) + for (int64_t nOffset : vSorted) if (nOffset != 0 && abs64(nOffset) < 5 * 60) fMatch = true; @@ -1373,7 +1372,7 @@ void AddTimeData(const CNetAddr& ip, int64_t nTime) } } if (fDebug) { - BOOST_FOREACH(int64_t n, vSorted) + for (int64_t n : vSorted) printf("%+" PRId64 " ", n); printf("| "); }