Skip to content

Commit 4ddd746

Browse files
committed
refactor: remove unnecessary string initializations
1 parent a65f6d8 commit 4ddd746

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/blockfilter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ bool GCSFilter::MatchAny(const ElementSet& elements) const
148148

149149
const std::string& BlockFilterTypeName(BlockFilterType filter_type)
150150
{
151-
static std::string unknown_retval = "";
151+
static std::string unknown_retval;
152152
auto it = g_filter_types.find(filter_type);
153153
return it != g_filter_types.end() ? it->second : unknown_retval;
154154
}

src/external_signer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ bool ExternalSigner::Enumerate(const std::string& command, std::vector<ExternalS
4949
if (signer.m_fingerprint.compare(fingerprintStr) == 0) duplicate = true;
5050
}
5151
if (duplicate) break;
52-
std::string name = "";
52+
std::string name;
5353
const UniValue& model_field = find_value(signer, "model");
5454
if (model_field.isStr() && model_field.getValStr() != "") {
5555
name += model_field.getValStr();

src/util/system.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ std::string ArgsManager::GetHelpMessage() const
740740
{
741741
const bool show_debug = GetBoolArg("-help-debug", false);
742742

743-
std::string usage = "";
743+
std::string usage;
744744
LOCK(cs_args);
745745
for (const auto& arg_map : m_available_args) {
746746
switch(arg_map.first) {

src/wallet/rpc/backup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ RPCHelpMan importprivkey()
140140
EnsureWalletIsUnlocked(*pwallet);
141141

142142
std::string strSecret = request.params[0].get_str();
143-
std::string strLabel = "";
143+
std::string strLabel;
144144
if (!request.params[1].isNull())
145145
strLabel = request.params[1].get_str();
146146

src/wallet/rpc/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ static RPCHelpMan loadwallet()
241241

242242
static RPCHelpMan setwalletflag()
243243
{
244-
std::string flags = "";
244+
std::string flags;
245245
for (auto& it : WALLET_FLAG_MAP)
246246
if (it.second & MUTABLE_WALLET_FLAGS)
247247
flags += (flags == "" ? "" : ", ") + it.first;

0 commit comments

Comments
 (0)