Skip to content

Commit 0d7efcd

Browse files
committed
core_read: Replace boost::split with SplitString
Note that `SplitString` doesn't support token compression, but in this case it does not matter as empty strings are already skipped anyways. Also removes split.hpp and classification.hpp from expected includes
1 parent b7ab9db commit 0d7efcd

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/core_read.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
#include <util/strencodings.h>
1515
#include <version.h>
1616

17-
#include <boost/algorithm/string/classification.hpp>
18-
#include <boost/algorithm/string/split.hpp>
19-
2017
#include <algorithm>
2118
#include <string>
2219

@@ -66,12 +63,11 @@ CScript ParseScript(const std::string& s)
6663
{
6764
CScript result;
6865

69-
std::vector<std::string> words;
70-
boost::algorithm::split(words, s, boost::algorithm::is_any_of(" \t\n"), boost::algorithm::token_compress_on);
66+
std::vector<std::string> words = SplitString(s, " \t\n");
7167

7268
for (const std::string& w : words) {
7369
if (w.empty()) {
74-
// Empty string, ignore. (boost::split given '' will return one word)
70+
// Empty string, ignore. (SplitString doesn't combine multiple separators)
7571
} else if (std::all_of(w.begin(), w.end(), ::IsDigit) ||
7672
(w.front() == '-' && w.size() > 1 && std::all_of(w.begin() + 1, w.end(), ::IsDigit)))
7773
{

test/lint/lint-includes.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
"src/univalue/"]
2323

2424
EXPECTED_BOOST_INCLUDES = ["boost/algorithm/string.hpp",
25-
"boost/algorithm/string/classification.hpp",
2625
"boost/algorithm/string/replace.hpp",
27-
"boost/algorithm/string/split.hpp",
2826
"boost/date_time/posix_time/posix_time.hpp",
2927
"boost/multi_index/hashed_index.hpp",
3028
"boost/multi_index/ordered_index.hpp",

0 commit comments

Comments
 (0)