aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.cpp
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-09-11 13:02:47 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2022-04-11 22:19:46 +0200
commit9cc8e876e412056ed22d364538f0da3d5d71946d (patch)
treecf30bf1d489e1bd7a37274deedf06fe60fb175b4 /src/rpc/util.cpp
parent2b5a741e98f186e50d9fbe1ceadcc8b8c91547f7 (diff)
downloadbitcoin-9cc8e876e412056ed22d364538f0da3d5d71946d.tar.xz
refactor: introduce single-separator split helper `SplitString`
This helper uses spanparsing::Split internally and enables to replace all calls to boost::split where only a single separator is passed. Co-authored-by: Martin Ankerl <Martin.Ankerl@gmail.com> Co-authored-by: MarcoFalke <falke.marco@gmail.com>
Diffstat (limited to 'src/rpc/util.cpp')
-rw-r--r--src/rpc/util.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp
index 01fae140cc..139bee1cf1 100644
--- a/src/rpc/util.cpp
+++ b/src/rpc/util.cpp
@@ -15,9 +15,6 @@
#include <tuple>
-#include <boost/algorithm/string/classification.hpp>
-#include <boost/algorithm/string/split.hpp>
-
const std::string UNIX_EPOCH_TIME = "UNIX epoch time";
const std::string EXAMPLE_ADDRESS[2] = {"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl", "bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3"};
@@ -513,8 +510,7 @@ RPCHelpMan::RPCHelpMan(std::string name, std::string description, std::vector<RP
{
std::set<std::string> named_args;
for (const auto& arg : m_args) {
- std::vector<std::string> names;
- boost::split(names, arg.m_names, boost::is_any_of("|"));
+ std::vector<std::string> names = SplitString(arg.m_names, '|');
// Should have unique named arguments
for (const std::string& name : names) {
CHECK_NONFATAL(named_args.insert(name).second);
@@ -665,8 +661,7 @@ UniValue RPCHelpMan::GetArgMap() const
UniValue arr{UniValue::VARR};
for (int i{0}; i < int(m_args.size()); ++i) {
const auto& arg = m_args.at(i);
- std::vector<std::string> arg_names;
- boost::split(arg_names, arg.m_names, boost::is_any_of("|"));
+ std::vector<std::string> arg_names = SplitString(arg.m_names, '|');
for (const auto& arg_name : arg_names) {
UniValue map{UniValue::VARR};
map.push_back(m_name);