Skip to content

Commit 6f4e393

Browse files
committed
refactor: remove use of boost::algorithm::replace_first
1 parent d67883d commit 6f4e393

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)