From 1df73dd9adb3c11af6a5a3dc5839b8f87e8070a0 Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 3 Sep 2013 03:36:18 +0000 Subject: Reduce NUM2INT invocations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/-test-/bignum/big2str.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/-test-/bignum') diff --git a/ext/-test-/bignum/big2str.c b/ext/-test-/bignum/big2str.c index 0c603a919f..ce71fe37e2 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 -- cgit v1.2.3