mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-09 18:00:13 +02:00
refactor: remove unnecessary string initializations
This commit is contained in:
@ -148,7 +148,7 @@ bool GCSFilter::MatchAny(const ElementSet& elements) const
|
|||||||
|
|
||||||
const std::string& BlockFilterTypeName(BlockFilterType filter_type)
|
const std::string& BlockFilterTypeName(BlockFilterType filter_type)
|
||||||
{
|
{
|
||||||
static std::string unknown_retval = "";
|
static std::string unknown_retval;
|
||||||
auto it = g_filter_types.find(filter_type);
|
auto it = g_filter_types.find(filter_type);
|
||||||
return it != g_filter_types.end() ? it->second : unknown_retval;
|
return it != g_filter_types.end() ? it->second : unknown_retval;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ bool ExternalSigner::Enumerate(const std::string& command, std::vector<ExternalS
|
|||||||
if (signer.m_fingerprint.compare(fingerprintStr) == 0) duplicate = true;
|
if (signer.m_fingerprint.compare(fingerprintStr) == 0) duplicate = true;
|
||||||
}
|
}
|
||||||
if (duplicate) break;
|
if (duplicate) break;
|
||||||
std::string name = "";
|
std::string name;
|
||||||
const UniValue& model_field = find_value(signer, "model");
|
const UniValue& model_field = find_value(signer, "model");
|
||||||
if (model_field.isStr() && model_field.getValStr() != "") {
|
if (model_field.isStr() && model_field.getValStr() != "") {
|
||||||
name += model_field.getValStr();
|
name += model_field.getValStr();
|
||||||
|
@ -740,7 +740,7 @@ std::string ArgsManager::GetHelpMessage() const
|
|||||||
{
|
{
|
||||||
const bool show_debug = GetBoolArg("-help-debug", false);
|
const bool show_debug = GetBoolArg("-help-debug", false);
|
||||||
|
|
||||||
std::string usage = "";
|
std::string usage;
|
||||||
LOCK(cs_args);
|
LOCK(cs_args);
|
||||||
for (const auto& arg_map : m_available_args) {
|
for (const auto& arg_map : m_available_args) {
|
||||||
switch(arg_map.first) {
|
switch(arg_map.first) {
|
||||||
|
@ -140,7 +140,7 @@ RPCHelpMan importprivkey()
|
|||||||
EnsureWalletIsUnlocked(*pwallet);
|
EnsureWalletIsUnlocked(*pwallet);
|
||||||
|
|
||||||
std::string strSecret = request.params[0].get_str();
|
std::string strSecret = request.params[0].get_str();
|
||||||
std::string strLabel = "";
|
std::string strLabel;
|
||||||
if (!request.params[1].isNull())
|
if (!request.params[1].isNull())
|
||||||
strLabel = request.params[1].get_str();
|
strLabel = request.params[1].get_str();
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ static RPCHelpMan loadwallet()
|
|||||||
|
|
||||||
static RPCHelpMan setwalletflag()
|
static RPCHelpMan setwalletflag()
|
||||||
{
|
{
|
||||||
std::string flags = "";
|
std::string flags;
|
||||||
for (auto& it : WALLET_FLAG_MAP)
|
for (auto& it : WALLET_FLAG_MAP)
|
||||||
if (it.second & MUTABLE_WALLET_FLAGS)
|
if (it.second & MUTABLE_WALLET_FLAGS)
|
||||||
flags += (flags == "" ? "" : ", ") + it.first;
|
flags += (flags == "" ? "" : ", ") + it.first;
|
||||||
|
Reference in New Issue
Block a user