aboutsummaryrefslogtreecommitdiff
path: root/src/bignum.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-11-04 05:55:37 -0800
committerWladimir J. van der Laan <laanwj@gmail.com>2013-11-04 05:55:37 -0800
commitbac72640ee4fbf32c639901229dcd714defa1baa (patch)
tree78ea27076d3d41c62d7ad873335c34a80f8343b9 /src/bignum.h
parent97f844dd95c54b0fe2f2a1bb006c74ff544ff125 (diff)
parentf171ec0c7d084b6bb163d1466edd814cf4dcbc93 (diff)
downloadbitcoin-bac72640ee4fbf32c639901229dcd714defa1baa.tar.xz
Merge pull request #3076 from lano1106/uint256_util
Make util phexdigit array reusable
Diffstat (limited to 'src/bignum.h')
-rw-r--r--src/bignum.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bignum.h b/src/bignum.h
index 582e6f1517..e9d9007d3d 100644
--- a/src/bignum.h
+++ b/src/bignum.h
@@ -347,13 +347,13 @@ public:
psz++;
// hex string to bignum
- static const signed char phexdigit[256] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0 };
*this = 0;
- while (isxdigit(*psz))
+ int n;
+ while ((n = HexDigit(*psz)) != -1)
{
*this <<= 4;
- int n = phexdigit[(unsigned char)*psz++];
*this += n;
+ ++psz;
}
if (fNegative)
*this = 0 - *this;