Switch to builtin tolower
authorsvost <ya.nowa@yandex.ru>
Sun, 2 Oct 2016 18:07:56 +0000 (21:07 +0300)
committersvost <ya.nowa@yandex.ru>
Sun, 2 Oct 2016 18:07:56 +0000 (21:07 +0300)
src/bitcoinrpc.cpp
src/netbase.cpp
src/util.cpp

index adaa354..0c7e278 100644 (file)
@@ -452,7 +452,7 @@ int ReadHTTPHeader(std::basic_istream<char>& stream, map<string, string>& mapHea
         {
             auto strHeader = str.substr(0, nColon);
             boost::trim(strHeader);
-            boost::to_lower(strHeader);
+            transform(strHeader.begin(), strHeader.end(), strHeader.begin(), ::tolower);
             auto strValue = str.substr(nColon+1);
             boost::trim(strValue);
             mapHeadersRet[strHeader] = strValue;
index 3f0d981..ebc5f9f 100644 (file)
@@ -21,8 +21,6 @@
 typedef SSIZE_T ssize_t;
 #endif
 
-#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
-
 using namespace std;
 
 // Settings
@@ -35,7 +33,7 @@ bool fNameLookup = false;
 static const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff };
 
 enum Network ParseNetwork(std::string net) {
-    boost::to_lower(net);
+    transform(net.begin(), net.end(), net.begin(), ::tolower);
     if (net == "ipv4") return NET_IPV4;
     if (net == "ipv6") return NET_IPV6;
     if (net == "tor" || net == "onion")  return NET_TOR;
@@ -127,7 +125,7 @@ bool LookupHost(const string& strName, std::vector<CNetAddr>& vIP, unsigned int
     std::string strHost(strName);
     if (strHost.empty())
         return false;
-    if ((strHost.compare(0,1, "[") == 0) && (strHost.compare(strHost.length()-1,1, "]") == 0))
+    if ((strHost.front() == '[') && (strHost.back() == ']'))
     {
         strHost = strHost.substr(1, strHost.size() - 2);
     }
@@ -140,7 +138,7 @@ bool LookupHost(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nM
     std::string strHost(pszName);
     if (strHost.empty())
         return false;
-    if ((strHost.compare(0,1, "[") == 0) && (strHost.compare(strHost.length()-1,1, "]") == 0))
+    if ((strHost.front() == '[') && (strHost.back() == ']'))
     {
         strHost = strHost.substr(1, strHost.size() - 2);
     }
index 4be37a2..f798da6 100644 (file)
@@ -11,7 +11,6 @@
 #include <random>
 
 #include <boost/algorithm/string/join.hpp>
-#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
 #include <boost/program_options/detail/config_file.hpp>
 #include <boost/program_options/parsers.hpp>
 #include <boost/filesystem.hpp>
@@ -514,7 +513,7 @@ void ParseParameters(int argc, const char* const argv[])
             str = str.substr(0, is_index);
         }
 #ifdef WIN32
-        boost::to_lower(str);
+        transform(str.begin(), str.end(), str.begin(), ::tolower);
         if (str.compare(0,1, "/") == 0)
             str = "-" + str.substr(1);
 #endif