diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-08 02:47:02 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-08 02:47:02 +0000 |
commit | 123437c984f71adb6c39393c608009b8b5a1344b (patch) | |
tree | a1b6c2bfaa84a753c367fe00a8ed98cd9e9e0b87 /bignum.c | |
parent | b4135fcbc612bb4bfb924ad60fd6fcf781a33500 (diff) | |
download | ruby-123437c984f71adb6c39393c608009b8b5a1344b.tar.gz ruby-123437c984f71adb6c39393c608009b8b5a1344b.tar.xz ruby-123437c984f71adb6c39393c608009b8b5a1344b.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@24444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; } |