From c1de2f4e3aa23cac7973ceb3f6c5477924c0d0ee Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 11 Feb 2014 14:43:23 +0000 Subject: * 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 --- ext/bigdecimal/bigdecimal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') 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; -- cgit v1.2.3