From: svost Date: Mon, 28 Mar 2016 09:16:44 +0000 (+0300) Subject: It's a c++: use string.clear() X-Git-Tag: nvc-v0.5.8~25^2^2~1 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=cecf7a56ed5a5efd939b21c760c69da616306005 It's a c++: use string.clear() --- diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 42687c8..0ac7652 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -466,7 +466,7 @@ int ReadHTTPHeader(std::basic_istream& stream, map& mapHea int ReadHTTP(std::basic_istream& stream, map& 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 diff --git a/src/db.cpp b/src/db.cpp index 68d19fe..e12e11e 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -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)); } diff --git a/src/net.cpp b/src/net.cpp index c69e83c..7255cab 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -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 diff --git a/src/net.h b/src/net.h index fc6fa39..f071ac7 100644 --- 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;