From b01312ab9760109353846c6fac3e0d135b7842b6 Mon Sep 17 00:00:00 2001 From: naruse Date: Sat, 19 Mar 2016 10:06:57 +0000 Subject: * numeric.c (fix_cmp): use rb_big_cmp if x is Fixnum and y is Bignum. rb_big_cmp handles such case smartly with big_norm. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index 178dbe1f02..53af5c5666 100644 --- a/numeric.c +++ b/numeric.c @@ -3425,7 +3425,7 @@ fix_cmp(VALUE x, VALUE y) return INT2FIX(-1); } else if (RB_TYPE_P(y, T_BIGNUM)) { - return rb_big_cmp(rb_int2big(FIX2LONG(x)), y); + return rb_big_cmp(y, x); } else if (RB_TYPE_P(y, T_FLOAT)) { return rb_integer_float_cmp(x, y); -- cgit v1.2.3