From d9f94aa882ae7ac5697d30c4478d9a1d633c3728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rinc?= Date: Fri, 6 Feb 2026 10:58:10 +0100 Subject: [PATCH] rpc: avoid moving RPC enum types `RPCArg::Type` and `RPCResult::Type` are enum values, so moving them in constructors is no different from copying them. Initialize the stored type fields directly. --- src/rpc/util.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rpc/util.h b/src/rpc/util.h index 77199dfe3fd..84cccb1eeb4 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 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 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 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},