From 4307340208f8b406708bcfb8d5583f6c4dfa7bc0 Mon Sep 17 00:00:00 2001 From: matz Date: Sat, 8 Aug 2009 02:47:02 +0000 Subject: * bignum.c (bigzero_p): removing BDIGITS() inside of the loop. inspired by Hitohiro Kanai's blog entry . git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bignum.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bignum.c') diff --git a/bignum.c b/bignum.c index bd9e0c8cae..9fa1f2aab3 100644 --- a/bignum.c +++ b/bignum.c @@ -46,8 +46,10 @@ static int bigzero_p(VALUE x) { long i; + BDIGIT *ds = BDIGITS(x); + for (i = RBIGNUM_LEN(x) - 1; 0 <= i; i--) { - if (BDIGITS(x)[i]) return 0; + if (ds[i]) return 0; } return 1; } -- cgit v1.2.3