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>
This commit is contained in:
Sebastian Falbesoner
2021-09-11 13:02:47 +02:00
parent 2b5a741e98
commit 9cc8e876e4
12 changed files with 47 additions and 71 deletions

View File

@@ -31,8 +31,6 @@
#include <map>
#include <string>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/test/unit_test.hpp>
#include <univalue.h>
@@ -70,8 +68,7 @@ unsigned int ParseScriptFlags(std::string strFlags)
{
if (strFlags.empty() || strFlags == "NONE") return 0;
unsigned int flags = 0;
std::vector<std::string> words;
boost::algorithm::split(words, strFlags, boost::algorithm::is_any_of(","));
std::vector<std::string> words = SplitString(strFlags, ',');
for (const std::string& word : words)
{