mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-23 15:22:46 +02:00
refactor: Remove const to fix performance-move-const-arg clang-tidy errors
The warnings look like: src/rpc/util.h:192:19: error: std::move of the const variable 'name' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors] : m_names{std::move(name)}, ^~~~~~~~~~ ~
This commit is contained in:
parent
635f1900d0
commit
fab92a5a5a
@ -178,10 +178,10 @@ struct RPCArg {
|
|||||||
const RPCArgOptions m_opts;
|
const RPCArgOptions m_opts;
|
||||||
|
|
||||||
RPCArg(
|
RPCArg(
|
||||||
const std::string name,
|
std::string name,
|
||||||
const Type type,
|
Type type,
|
||||||
const Fallback fallback,
|
Fallback fallback,
|
||||||
const std::string description,
|
std::string description,
|
||||||
RPCArgOptions opts = {})
|
RPCArgOptions opts = {})
|
||||||
: m_names{std::move(name)},
|
: m_names{std::move(name)},
|
||||||
m_type{std::move(type)},
|
m_type{std::move(type)},
|
||||||
@ -193,11 +193,11 @@ struct RPCArg {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RPCArg(
|
RPCArg(
|
||||||
const std::string name,
|
std::string name,
|
||||||
const Type type,
|
Type type,
|
||||||
const Fallback fallback,
|
Fallback fallback,
|
||||||
const std::string description,
|
std::string description,
|
||||||
const std::vector<RPCArg> inner,
|
std::vector<RPCArg> inner,
|
||||||
RPCArgOptions opts = {})
|
RPCArgOptions opts = {})
|
||||||
: m_names{std::move(name)},
|
: m_names{std::move(name)},
|
||||||
m_type{std::move(type)},
|
m_type{std::move(type)},
|
||||||
@ -263,12 +263,12 @@ struct RPCResult {
|
|||||||
const std::string m_cond;
|
const std::string m_cond;
|
||||||
|
|
||||||
RPCResult(
|
RPCResult(
|
||||||
const std::string cond,
|
std::string cond,
|
||||||
const Type type,
|
Type type,
|
||||||
const std::string m_key_name,
|
std::string m_key_name,
|
||||||
const bool optional,
|
bool optional,
|
||||||
const std::string description,
|
std::string description,
|
||||||
const std::vector<RPCResult> inner = {})
|
std::vector<RPCResult> inner = {})
|
||||||
: m_type{std::move(type)},
|
: m_type{std::move(type)},
|
||||||
m_key_name{std::move(m_key_name)},
|
m_key_name{std::move(m_key_name)},
|
||||||
m_inner{std::move(inner)},
|
m_inner{std::move(inner)},
|
||||||
@ -282,19 +282,19 @@ struct RPCResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RPCResult(
|
RPCResult(
|
||||||
const std::string cond,
|
std::string cond,
|
||||||
const Type type,
|
Type type,
|
||||||
const std::string m_key_name,
|
std::string m_key_name,
|
||||||
const std::string description,
|
std::string description,
|
||||||
const std::vector<RPCResult> inner = {})
|
std::vector<RPCResult> inner = {})
|
||||||
: RPCResult{cond, type, m_key_name, false, description, inner} {}
|
: RPCResult{std::move(cond), type, std::move(m_key_name), /*optional=*/false, std::move(description), std::move(inner)} {}
|
||||||
|
|
||||||
RPCResult(
|
RPCResult(
|
||||||
const Type type,
|
Type type,
|
||||||
const std::string m_key_name,
|
std::string m_key_name,
|
||||||
const bool optional,
|
bool optional,
|
||||||
const std::string description,
|
std::string description,
|
||||||
const std::vector<RPCResult> inner = {},
|
std::vector<RPCResult> inner = {},
|
||||||
bool skip_type_check = false)
|
bool skip_type_check = false)
|
||||||
: m_type{std::move(type)},
|
: m_type{std::move(type)},
|
||||||
m_key_name{std::move(m_key_name)},
|
m_key_name{std::move(m_key_name)},
|
||||||
@ -308,12 +308,12 @@ struct RPCResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RPCResult(
|
RPCResult(
|
||||||
const Type type,
|
Type type,
|
||||||
const std::string m_key_name,
|
std::string m_key_name,
|
||||||
const std::string description,
|
std::string description,
|
||||||
const std::vector<RPCResult> inner = {},
|
std::vector<RPCResult> inner = {},
|
||||||
bool skip_type_check = false)
|
bool skip_type_check = false)
|
||||||
: RPCResult{type, m_key_name, false, description, inner, skip_type_check} {}
|
: RPCResult{type, std::move(m_key_name), /*optional=*/false, std::move(description), std::move(inner), skip_type_check} {}
|
||||||
|
|
||||||
/** Append the sections of the result. */
|
/** Append the sections of the result. */
|
||||||
void ToSections(Sections& sections, OuterType outer_type = OuterType::NONE, const int current_indent = 0) const;
|
void ToSections(Sections& sections, OuterType outer_type = OuterType::NONE, const int current_indent = 0) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user