[前][次][番号順一覧][スレッド一覧]

ruby-changes:12723

From: matz <ko1@a...>
Date: Sat, 8 Aug 2009 11:49:16 +0900 (JST)
Subject: [ruby-changes:12723] Ruby:r24444 (trunk): * bignum.c (bigzero_p): removing BDIGITS() inside of the

matz	2009-08-08 11:47:02 +0900 (Sat, 08 Aug 2009)

  New Revision: 24444

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24444

  Log:
    * 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>.

  Modified files:
    trunk/ChangeLog
    trunk/bignum.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 24443)
+++ ChangeLog	(revision 24444)
@@ -1,3 +1,9 @@
+Sat Aug  8 11:42:44 2009  Yukihiro Matsumoto  <matz@r...>
+
+	* 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@r...>
 
 	* marshal.c (w_symbol r_symlink, r_symbol, r_object0): fix for
Index: bignum.c
===================================================================
--- bignum.c	(revision 24443)
+++ bignum.c	(revision 24444)
@@ -46,8 +46,10 @@
 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;
 }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]