1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2009-08-08 02:47:02 +00:00
parent ac2557e09f
commit 4307340208
2 changed files with 9 additions and 1 deletions

View file

@ -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

View file

@ -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;
}