aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/client.h
diff options
context:
space:
mode:
authorstickies-v <stickies-v@protonmail.com>2022-11-30 17:16:04 +0000
committerstickies-v <stickies-v@protonmail.com>2023-01-18 17:08:58 +0000
commit545ff924ab6303ffabd91fdfc4f0a4962daf133c (patch)
tree2d6fd50f133eed48925d290469fdfed6dbd7cea2 /src/rpc/client.h
parent7727603e44f8f674e0fc8389e78047e2b56e6052 (diff)
downloadbitcoin-545ff924ab6303ffabd91fdfc4f0a4962daf133c.tar.xz
refactor: use string_view for RPC named argument values
Minimize copying RPC named argument values when calling .substr() by using std::string_view instead of std::string.
Diffstat (limited to 'src/rpc/client.h')
-rw-r--r--src/rpc/client.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rpc/client.h b/src/rpc/client.h
index 644081ac22..3c5c4fc4d6 100644
--- a/src/rpc/client.h
+++ b/src/rpc/client.h
@@ -6,6 +6,9 @@
#ifndef BITCOIN_RPC_CLIENT_H
#define BITCOIN_RPC_CLIENT_H
+#include <string>
+#include <string_view>
+
#include <univalue.h>
/** Convert positional arguments to command-specific RPC representation */
@@ -17,6 +20,6 @@ UniValue RPCConvertNamedValues(const std::string& strMethod, const std::vector<s
/** Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, false, null)
* as well as objects and arrays.
*/
-UniValue ParseNonRFCJSONValue(const std::string& raw);
+UniValue ParseNonRFCJSONValue(std::string_view raw);
#endif // BITCOIN_RPC_CLIENT_H