summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--bignum.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f808ca0b80..784f8afc4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Aug 8 11:42:44 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * bignum.c (bigzero_p): removing BDIGITS() inside of the
+ loop. inspired by Hitohiro Kanai's blog entry
+ <http://d.hatena.ne.jp/CanI/20090807/1249657492>.
+
Sat Aug 8 06:18:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* marshal.c (w_symbol r_symlink, r_symbol, r_object0): fix for
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;
}