Skip to content

Commit fbb2bee

Browse files
committed
Merge bitcoin#20067: refactor: remove use of boost::algorithm::replace_first
6f4e393 refactor: remove use of boost::algorithm::replace_first (Sebastian Falbesoner) Pull request description: As discussed in bitcoin#19851 (bitcoin#19851 (comment)), this trivial PR substitutes the (only) use of `boost::algorithm::replace_first` by a direct implementation. ACKs for top commit: laanwj: Code review ACK 6f4e393 Tree-SHA512: 2ef06498e19f864a4cbae10e8d1905e3440a2d1e8e5aae83de7597c23cdab92b4612d7fa1efbc49016e530debd127d1d50531c60ff159dbea0deaa8c836a2bfb
2 parents e12ad7f + 6f4e393 commit fbb2bee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core_read.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <version.h>
1616

1717
#include <boost/algorithm/string/classification.hpp>
18-
#include <boost/algorithm/string/replace.hpp>
1918
#include <boost/algorithm/string/split.hpp>
2019

2120
#include <algorithm>
@@ -40,8 +39,9 @@ CScript ParseScript(const std::string& s)
4039
continue;
4140
mapOpNames[strName] = static_cast<opcodetype>(op);
4241
// Convenience: OP_ADD and just ADD are both recognized:
43-
boost::algorithm::replace_first(strName, "OP_", "");
44-
mapOpNames[strName] = static_cast<opcodetype>(op);
42+
if (strName.compare(0, 3, "OP_") == 0) { // strName starts with "OP_"
43+
mapOpNames[strName.substr(3)] = static_cast<opcodetype>(op);
44+
}
4545
}
4646
}
4747

0 commit comments

Comments
 (0)