It's a c++: use string.clear()
authorsvost <ya.nowa@yandex.ru>
Mon, 28 Mar 2016 09:16:44 +0000 (12:16 +0300)
committersvost <ya.nowa@yandex.ru>
Mon, 28 Mar 2016 09:16:44 +0000 (12:16 +0300)
src/bitcoinrpc.cpp
src/db.cpp
src/net.cpp
src/net.h

index 42687c8..0ac7652 100644 (file)
@@ -466,7 +466,7 @@ int ReadHTTPHeader(std::basic_istream<char>& stream, map<string, string>& mapHea
 int ReadHTTP(std::basic_istream<char>& stream, map<string, string>& mapHeadersRet, string& strMessageRet)
 {
     mapHeadersRet.clear();
-    strMessageRet = "";
+    strMessageRet.clear();
 
     // Read status
     int nProto = 0;
@@ -1299,7 +1299,7 @@ int CommandLineRPC(int argc, char *argv[])
         {
             // Result
             if (result.type() == null_type)
-                strPrint = "";
+                strPrint.clear();
             else if (result.type() == str_type)
                 strPrint = result.get_str();
             else
index 68d19fe..e12e11e 100644 (file)
@@ -288,7 +288,7 @@ CDB::CDB(const char *pszFile, const char* pszMode) :
                 delete pdb;
                 pdb = NULL;
                 --bitdb.mapFileUseCount[strFile];
-                strFile = "";
+                strFile.clear();
                 throw runtime_error(strprintf("CDB() : can't open database file %s, error %d", pszFile, ret));
             }
 
index c69e83c..7255cab 100644 (file)
@@ -142,7 +142,7 @@ CAddress GetLocalAddress(const CNetAddr *paddrPeer)
 
 bool RecvLine(SOCKET hSocket, string& strLine)
 {
-    strLine = "";
+    strLine.clear();
     for ( ; ; )
     {
         char c;
@@ -1528,7 +1528,7 @@ void ThreadMessageHandler2(void* parg)
 
 bool BindListenPort(const CService &addrBind, string& strError)
 {
-    strError = "";
+    strError.clear();
     int nOne = 1;
 
     // Create socket for listening for incoming connections
index fc6fa39..f071ac7 100644 (file)
--- a/src/net.h
+++ b/src/net.h
@@ -238,7 +238,7 @@ public:
         addr = addrIn;
         addrName = addrNameIn.empty() ? addr.ToStringIPPort() : addrNameIn;
         nVersion = 0;
-        strSubVer = "";
+        strSubVer.clear();
         fOneShot = false;
         fClient = false; // set by version message
         fInbound = fInboundIn;