diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-11-04 05:55:37 -0800 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-11-04 05:55:37 -0800 |
commit | bac72640ee4fbf32c639901229dcd714defa1baa (patch) | |
tree | 78ea27076d3d41c62d7ad873335c34a80f8343b9 /src/util.cpp | |
parent | 97f844dd95c54b0fe2f2a1bb006c74ff544ff125 (diff) | |
parent | f171ec0c7d084b6bb163d1466edd814cf4dcbc93 (diff) |
Merge pull request #3076 from lano1106/uint256_util
Make util phexdigit array reusable
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/util.cpp b/src/util.cpp index 085df8a7d5..539e759ddd 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -460,7 +460,7 @@ bool ParseMoney(const char* pszIn, int64& nRet) } -static const signed char phexdigit[256] = +const signed char p_util_hexdigit[256] = { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, @@ -480,9 +480,9 @@ static const signed char phexdigit[256] = bool IsHex(const string& str) { - BOOST_FOREACH(unsigned char c, str) + BOOST_FOREACH(char c, str) { - if (phexdigit[c] < 0) + if (HexDigit(c) < 0) return false; } return (str.size() > 0) && (str.size()%2 == 0); @@ -496,11 +496,11 @@ vector<unsigned char> ParseHex(const char* psz) { while (isspace(*psz)) psz++; - signed char c = phexdigit[(unsigned char)*psz++]; + signed char c = HexDigit(*psz++); if (c == (signed char)-1) break; unsigned char n = (c << 4); - c = phexdigit[(unsigned char)*psz++]; + c = HexDigit(*psz++); if (c == (signed char)-1) break; n |= c; |