diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-03-01 20:50:33 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-03-01 20:51:05 +0100 |
commit | 90a0aed51194ad82da8e011b96f9561c685e40b7 (patch) | |
tree | 422b2bb0699cdc1a8753441c47bd08cd5eaf0a13 | |
parent | a4a5fc7c17cd63fae39db3b01b4bc1b0a32b6e1f (diff) | |
parent | 19ac86e2063432fca1f21fd3ef9770e7bde5d0ff (diff) |
Merge #12182: Remove useless string initializations
19ac86e Remove useless string initialization. (Alin Rus)
Pull request description:
Tree-SHA512: 4273dd7e8ed083cc9d05fc70967465e405085b630c000f829648dd44dd0cfe2249f6af1498b02f54b4ca73833130b802488bae8eca0d4d0b803a6f0122b19e8f
-rw-r--r-- | src/netbase.cpp | 2 | ||||
-rw-r--r-- | src/rest.cpp | 2 | ||||
-rw-r--r-- | src/test/net_tests.cpp | 2 | ||||
-rw-r--r-- | src/utilstrencodings.cpp | 4 | ||||
-rw-r--r-- | src/wallet/rpcdump.cpp | 4 |
5 files changed, 7 insertions, 7 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp index 5be3fe34f8..3ea3141d5e 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -139,7 +139,7 @@ bool Lookup(const char *pszName, std::vector<CService>& vAddr, int portDefault, if (pszName[0] == 0) return false; int port = portDefault; - std::string hostname = ""; + std::string hostname; SplitHostPort(std::string(pszName), port, hostname); std::vector<CNetAddr> vIP; diff --git a/src/rest.cpp b/src/rest.cpp index eeeb3f5141..8cba59dbbc 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -90,7 +90,7 @@ static enum RetFormat ParseDataFormat(std::string& param, const std::string& str static std::string AvailableDataFormatsString() { - std::string formats = ""; + std::string formats; for (unsigned int i = 0; i < ARRAYLEN(rf_names); i++) if (strlen(rf_names[i].name) > 0) { formats.append("."); diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp index ca57f58905..e03234060d 100644 --- a/src/test/net_tests.cpp +++ b/src/test/net_tests.cpp @@ -171,7 +171,7 @@ BOOST_AUTO_TEST_CASE(cnode_simple_test) ipv4Addr.s_addr = 0xa0b0c001; CAddress addr = CAddress(CService(ipv4Addr, 7777), NODE_NETWORK); - std::string pszDest = ""; + std::string pszDest; bool fInboundIn = false; // Test that fFeeler is false by default. diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index 52158e9804..ebafe078f4 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -127,7 +127,7 @@ std::string EncodeBase64(const unsigned char* pch, size_t len) { static const char *pbase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - std::string strRet = ""; + std::string strRet; strRet.reserve((len+2)/3*4); int mode=0, left=0; @@ -267,7 +267,7 @@ std::string EncodeBase32(const unsigned char* pch, size_t len) { static const char *pbase32 = "abcdefghijklmnopqrstuvwxyz234567"; - std::string strRet=""; + std::string strRet; strRet.reserve((len+4)/5*8); int mode=0, left=0; diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 741ea25340..930e8bbbb4 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -279,7 +279,7 @@ UniValue importaddress(const JSONRPCRequest& request) ); - std::string strLabel = ""; + std::string strLabel; if (!request.params[1].isNull()) strLabel = request.params[1].get_str(); @@ -452,7 +452,7 @@ UniValue importpubkey(const JSONRPCRequest& request) ); - std::string strLabel = ""; + std::string strLabel; if (!request.params[1].isNull()) strLabel = request.params[1].get_str(); |