aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Leitner-Ankerl <martin.ankerl@gmail.com>2022-05-02 21:45:23 +0200
committerMartin Leitner-Ankerl <martin.ankerl@gmail.com>2022-05-04 07:34:47 +0200
commit0d7efcdf75607e19fac77bcd146773a03af14492 (patch)
tree2c632e5c4ae58ddaef9289bb8929308f260f37b5
parentb7ab9db545492927b774912e53aeb834a590621f (diff)
downloadbitcoin-0d7efcdf75607e19fac77bcd146773a03af14492.tar.xz
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
-rw-r--r--src/core_read.cpp8
-rwxr-xr-xtest/lint/lint-includes.py2
2 files changed, 2 insertions, 8 deletions
diff --git a/src/core_read.cpp b/src/core_read.cpp
index 3bab5b5d98..77c516427a 100644
--- a/src/core_read.cpp
+++ b/src/core_read.cpp
@@ -14,9 +14,6 @@
#include <util/strencodings.h>
#include <version.h>
-#include <boost/algorithm/string/classification.hpp>
-#include <boost/algorithm/string/split.hpp>
-
#include <algorithm>
#include <string>
@@ -66,12 +63,11 @@ CScript ParseScript(const std::string& s)
{
CScript result;
- std::vector<std::string> words;
- boost::algorithm::split(words, s, boost::algorithm::is_any_of(" \t\n"), boost::algorithm::token_compress_on);
+ std::vector<std::string> words = SplitString(s, " \t\n");
for (const std::string& w : words) {
if (w.empty()) {
- // Empty string, ignore. (boost::split given '' will return one word)
+ // Empty string, ignore. (SplitString doesn't combine multiple separators)
} else if (std::all_of(w.begin(), w.end(), ::IsDigit) ||
(w.front() == '-' && w.size() > 1 && std::all_of(w.begin() + 1, w.end(), ::IsDigit)))
{
diff --git a/test/lint/lint-includes.py b/test/lint/lint-includes.py
index b29c7f8b4d..86ebb814c2 100755
--- a/test/lint/lint-includes.py
+++ b/test/lint/lint-includes.py
@@ -22,9 +22,7 @@ EXCLUDED_DIRS = ["src/leveldb/",
"src/univalue/"]
EXPECTED_BOOST_INCLUDES = ["boost/algorithm/string.hpp",
- "boost/algorithm/string/classification.hpp",
"boost/algorithm/string/replace.hpp",
- "boost/algorithm/string/split.hpp",
"boost/date_time/posix_time/posix_time.hpp",
"boost/multi_index/hashed_index.hpp",
"boost/multi_index/ordered_index.hpp",