diff options
author | stickies-v <stickies-v@protonmail.com> | 2022-11-30 17:16:04 +0000 |
---|---|---|
committer | stickies-v <stickies-v@protonmail.com> | 2023-01-18 17:08:58 +0000 |
commit | 545ff924ab6303ffabd91fdfc4f0a4962daf133c (patch) | |
tree | 2d6fd50f133eed48925d290469fdfed6dbd7cea2 /src/rpc/client.h | |
parent | 7727603e44f8f674e0fc8389e78047e2b56e6052 (diff) | |
download | bitcoin-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.h | 5 |
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 |