What changed, and why it matters
This is a tiny code-cleanup change in Bitcoin Core's RPC helper code. It removes unnecessary 'std::move' calls on plain enum values, which do not benefit from moving. There is no security impact.
No action needed. This is a benign cleanup commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies constructor initializer lists in src/rpc/util.h for RPCArg and RPCResult. The fields m_type are enum types (RPCArg::Type and RPCResult::Type). Moving an enum is semantically identical to copying it and can be misleading or trigger compiler warnings. The patch initializes the enum fields directly. This is a non-functional style/refactor change.
Changed components
src/rpc/util.hInspect captured patch +4 / −4
diff --git a/src/rpc/util.h b/src/rpc/util.h
index 77199dfe..84cccb1e 100644
--- a/src/rpc/util.h
+++ b/src/rpc/util.h
@@ -236,7 +236,7 @@ struct RPCArg {
std::string description,
RPCArgOptions opts = {})
: m_names{std::move(name)},
- m_type{std::move(type)},
+ m_type{type},
m_fallback{std::move(fallback)},
m_description{std::move(description)},
m_opts{std::move(opts)}
@@ -252,7 +252,7 @@ struct RPCArg {
std::vector<RPCArg> inner,
RPCArgOptions opts = {})
: m_names{std::move(name)},
- m_type{std::move(type)},
+ m_type{type},
m_inner{std::move(inner)},
m_fallback{std::move(fallback)},
m_description{std::move(description)},
@@ -338,7 +338,7 @@ struct RPCResult {
std::string description,
std::vector<RPCResult> inner = {},
RPCResultOptions opts = {})
- : m_type{std::move(type)},
+ : m_type{type},
m_key_name{std::move(m_key_name)},
m_inner{std::move(inner)},
m_optional{optional},
@@ -366,7 +366,7 @@ struct RPCResult {
std::string description,
std::vector<RPCResult> inner = {},
RPCResultOptions opts = {})
- : m_type{std::move(type)},
+ : m_type{type},
m_key_name{std::move(m_key_name)},
m_inner{std::move(inner)},
m_optional{optional},
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.