diff options
author | Calvin Kim <calvin@kcalvinalvin.info> | 2020-05-18 17:14:10 +0900 |
---|---|---|
committer | Calvin Kim <calvin@kcalvinalvin.info> | 2020-05-22 01:40:31 +0900 |
commit | c57f03ce1741b38af448bec7b22ab9f8ac21f067 (patch) | |
tree | fc53ee2ad75995ae01f998dca70574754ee91f7b /src/core_read.cpp | |
parent | dc5333d31f280e09bb1e8cdacfbe842f4ab9e69b (diff) |
refactor: Replace const char* to std::string
Some functions should be returning std::string instead of const char*.
This commit changes that.
Diffstat (limited to 'src/core_read.cpp')
-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 df78c319ee..1c0a8a096d 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -19,6 +19,7 @@ #include <boost/algorithm/string/split.hpp> #include <algorithm> +#include <string> CScript ParseScript(const std::string& s) { @@ -34,10 +35,9 @@ CScript ParseScript(const std::string& s) if (op < OP_NOP && op != OP_RESERVED) continue; - const char* name = GetOpName(static_cast<opcodetype>(op)); - if (strcmp(name, "OP_UNKNOWN") == 0) + std::string strName = GetOpName(static_cast<opcodetype>(op)); + if (strName == "OP_UNKNOWN") continue; - std::string strName(name); mapOpNames[strName] = static_cast<opcodetype>(op); // Convenience: OP_ADD and just ADD are both recognized: boost::algorithm::replace_first(strName, "OP_", ""); |