diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-11 14:43:23 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-11 14:43:23 +0000 |
commit | c1de2f4e3aa23cac7973ceb3f6c5477924c0d0ee (patch) | |
tree | 809501c78c6314b9024a3cbcc3fb9428298af766 /ext/bigdecimal | |
parent | ab67419b755af54aeee3319a1cddb62408f1dcc9 (diff) | |
download | ruby-c1de2f4e3aa23cac7973ceb3f6c5477924c0d0ee.tar.gz |
* bignum.c (rb_big_cmp): Specialize a comparison to zero.
* ext/bigdecimal/bigdecimal.c (is_negative): Use rb_big_cmp instead of
RBIGNUM_NEGATIVE_P.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal')
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 206e5d3f5a..f426a45cef 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -2095,7 +2095,7 @@ is_negative(VALUE x) return FIX2LONG(x) < 0; } else if (RB_TYPE_P(x, T_BIGNUM)) { - return RBIGNUM_NEGATIVE_P(x); + return FIX2INT(rb_big_cmp(x, INT2FIX(0))) < 0; } else if (RB_TYPE_P(x, T_FLOAT)) { return RFLOAT_VALUE(x) < 0.0; |