diff --git a/src/netbase.cpp b/src/netbase.cpp --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -156,7 +156,7 @@ return false; } int port = portDefault; - std::string hostname = ""; + std::string hostname; SplitHostPort(std::string(pszName), port, hostname); std::vector vIP; diff --git a/src/rest.cpp b/src/rest.cpp --- a/src/rest.cpp +++ b/src/rest.cpp @@ -95,7 +95,7 @@ } static std::string AvailableDataFormatsString() { - std::string formats = ""; + std::string formats; for (size_t 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 --- a/src/test/net_tests.cpp +++ b/src/test/net_tests.cpp @@ -168,7 +168,7 @@ 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 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -137,7 +137,7 @@ static const char *pbase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - std::string strRet = ""; + std::string strRet; strRet.reserve((len + 2) / 3 * 4); int mode = 0, left = 0; @@ -276,7 +276,7 @@ std::string EncodeBase32(const uint8_t *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 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -285,7 +285,7 @@ "\"myscript\", \"testing\", false")); } - std::string strLabel = ""; + std::string strLabel; if (!request.params[1].isNull()) { strLabel = request.params[1].get_str(); } @@ -504,7 +504,7 @@ HelpExampleRpc("importpubkey", "\"mypubkey\", \"testing\", false")); } - std::string strLabel = ""; + std::string strLabel; if (!request.params[1].isNull()) { strLabel = request.params[1].get_str(); }