diff options
author | fanquake <fanquake@gmail.com> | 2022-05-04 18:09:35 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-05-04 18:20:27 +0100 |
commit | bde5836f99966b382463a585db87faae27514a70 (patch) | |
tree | 31d75b513933af7b18a1d36a04097d37e96e06ca /src/core_read.cpp | |
parent | 9183c66cc6ae173e0f2efe52b09cb9a8e64d5550 (diff) | |
parent | f849e63bad963b8717d4bc45efdad9b08567a36e (diff) | |
download | bitcoin-bde5836f99966b382463a585db87faae27514a70.tar.xz |
Merge bitcoin/bitcoin#25057: refactor: replace remaining boost::split with SplitString
f849e63bad963b8717d4bc45efdad9b08567a36e fuzz: SplitString with multiple separators (Martin Leitner-Ankerl)
d1a9850102fe572b8a1e00b80c757dd82bf39f9d http: replace boost::split with SplitString (Martin Leitner-Ankerl)
0d7efcdf75607e19fac77bcd146773a03af14492 core_read: Replace boost::split with SplitString (Martin Leitner-Ankerl)
b7ab9db545492927b774912e53aeb834a590621f Extend Split to work with multiple separators (Martin Leitner-Ankerl)
Pull request description:
As a followup of #22953, this removes the remaining occurrences of `boost::split` and replaces them with our own `SplitString`. To be able to do so, this extends the function `spanparsing::Split` to work with multiple separators. Finally this removes 3 more files from `lint-includes.py`.
ACKs for top commit:
theStack:
Code-review ACK f849e63bad963b8717d4bc45efdad9b08567a36e
Tree-SHA512: f37d4dbe11cab2046e646045b0f018a75f978d521443a2c5001512737a1370e22b09247d5db0e5c9e4153229a4e2d66731903c1bba3713711c4cae8cedcc775d
Diffstat (limited to 'src/core_read.cpp')
-rw-r--r-- | src/core_read.cpp | 8 |
1 files changed, 2 insertions, 6 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))) { |