summaryrefslogtreecommitdiff
path: root/ext/-test-/bignum
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-03 03:36:18 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-03 03:36:18 +0000
commit1df73dd9adb3c11af6a5a3dc5839b8f87e8070a0 (patch)
treeaab5a6314697f03bd9e3748e951fa9d7a2254963 /ext/-test-/bignum
parentbc3d736f4359bf84800008c2c9480e19839fd60a (diff)
Reduce NUM2INT invocations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/-test-/bignum')
-rw-r--r--ext/-test-/bignum/big2str.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/-test-/bignum/big2str.c b/ext/-test-/bignum/big2str.c
index 0c603a9..ce71fe3 100644
--- a/ext/-test-/bignum/big2str.c
+++ b/ext/-test-/bignum/big2str.c
@@ -18,7 +18,7 @@ big2str_generic(VALUE x, VALUE vbase)
int base = NUM2INT(vbase);
if (base < 2 || 36 < base)
rb_raise(rb_eArgError, "invalid radix %d", base);
- return rb_big2str_generic(big(x), NUM2INT(vbase));
+ return rb_big2str_generic(big(x), base);
}
#define POW2_P(x) (((x)&((x)-1))==0)
@@ -29,7 +29,7 @@ big2str_poweroftwo(VALUE x, VALUE vbase)
int base = NUM2INT(vbase);
if (base < 2 || 36 < base || !POW2_P(base))
rb_raise(rb_eArgError, "invalid radix %d", base);
- return rb_big2str_poweroftwo(big(x), NUM2INT(vbase));
+ return rb_big2str_poweroftwo(big(x), base);
}
#if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H)
@@ -39,7 +39,7 @@ big2str_gmp(VALUE x, VALUE vbase)
int base = NUM2INT(vbase);
if (base < 2 || 36 < base)
rb_raise(rb_eArgError, "invalid radix %d", base);
- return rb_big2str_gmp(big(x), NUM2INT(vbase));
+ return rb_big2str_gmp(big(x), base);
}
#else
#define big2str_gmp rb_f_notimplement