diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-11-19 11:48:24 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-11-19 11:50:53 +0100 |
commit | fbb2bee82d83f10f0365388579ab063ad39ecd28 (patch) | |
tree | 1b40580ffe7a98c281cac9e2edf26a44ccd589a0 | |
parent | e12ad7f383462c51af3d41a83f37c5e5a4c4dabc (diff) | |
parent | 6f4e3936461d0893250e7684928339f6cedf4d0c (diff) | |
download | bitcoin-fbb2bee82d83f10f0365388579ab063ad39ecd28.tar.xz |
Merge #20067: refactor: remove use of boost::algorithm::replace_first
6f4e3936461d0893250e7684928339f6cedf4d0c refactor: remove use of boost::algorithm::replace_first (Sebastian Falbesoner)
Pull request description:
As discussed in #19851 (https://github.com/bitcoin/bitcoin/pull/19851#issuecomment-685424702), this trivial PR substitutes the (only) use of `boost::algorithm::replace_first` by a direct implementation.
ACKs for top commit:
laanwj:
Code review ACK 6f4e3936461d0893250e7684928339f6cedf4d0c
Tree-SHA512: 2ef06498e19f864a4cbae10e8d1905e3440a2d1e8e5aae83de7597c23cdab92b4612d7fa1efbc49016e530debd127d1d50531c60ff159dbea0deaa8c836a2bfb
-rw-r--r-- | src/core_read.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core_read.cpp b/src/core_read.cpp index 121e62457c..c6416e6f07 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -15,7 +15,6 @@ #include <version.h> #include <boost/algorithm/string/classification.hpp> -#include <boost/algorithm/string/replace.hpp> #include <boost/algorithm/string/split.hpp> #include <algorithm> @@ -40,8 +39,9 @@ CScript ParseScript(const std::string& s) continue; mapOpNames[strName] = static_cast<opcodetype>(op); // Convenience: OP_ADD and just ADD are both recognized: - boost::algorithm::replace_first(strName, "OP_", ""); - mapOpNames[strName] = static_cast<opcodetype>(op); + if (strName.compare(0, 3, "OP_") == 0) { // strName starts with "OP_" + mapOpNames[strName.substr(3)] = static_cast<opcodetype>(op); + } } } |