aboutsummaryrefslogtreecommitdiffstats
path: root/bignum.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-03 13:32:14 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-03 13:32:14 +0000
commitb2be623240af7b3318596fa348d2c7920f8703b5 (patch)
tree475d7bd4aeac575fe74120e102be3a2211c4f313 /bignum.c
parent48ebea719f4478245a90352cfbfd5146ce65ca9e (diff)
downloadruby-b2be623240af7b3318596fa348d2c7920f8703b5.tar.gz
* internal.h (ruby_digit36_to_number_table): Declared.
* util.c (ruby_digit36_to_number_table): Moved from scan_digits. * bignum.c (conv_digit): Use ruby_digit36_to_number_table. * pack.c (hex2num): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/bignum.c b/bignum.c
index 3d66c8a1ad..27be47f64b 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1916,12 +1916,7 @@ rb_cstr_to_inum(const char *str, int base, int badcheck)
#undef ISDIGIT
#define ISDIGIT(c) ('0' <= (c) && (c) <= '9')
-#define conv_digit(c) \
- (!ISASCII(c) ? -1 : \
- ISDIGIT(c) ? ((c) - '0') : \
- ISLOWER(c) ? ((c) - 'a' + 10) : \
- ISUPPER(c) ? ((c) - 'A' + 10) : \
- -1)
+#define conv_digit(c) (ruby_digit36_to_number_table[(unsigned char)(c)])
if (!str) {
if (badcheck) goto bad;