From bbd1e83e5aa15f2f5fd3afa569de04bbd9c21eec Mon Sep 17 00:00:00 2001 From: mrkn Date: Tue, 8 Jan 2019 04:53:06 +0000 Subject: [PATCH] complex.c: replace misused UNLIKELY with LIKELY git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- complex.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/complex.c b/complex.c index 6c94f9a764..25afdc0c00 100644 --- a/complex.c +++ b/complex.c @@ -72,7 +72,7 @@ inline static VALUE f_add(VALUE x, VALUE y) { if (RB_INTEGER_TYPE_P(x) && - UNLIKELY(rb_method_basic_definition_p(rb_cInteger, idPLUS))) { + LIKELY(rb_method_basic_definition_p(rb_cInteger, idPLUS))) { if (FIXNUM_ZERO_P(x)) return y; if (FIXNUM_ZERO_P(y)) @@ -80,13 +80,13 @@ f_add(VALUE x, VALUE y) return rb_int_plus(x, y); } else if (RB_FLOAT_TYPE_P(x) && - UNLIKELY(rb_method_basic_definition_p(rb_cFloat, idPLUS))) { + LIKELY(rb_method_basic_definition_p(rb_cFloat, idPLUS))) { if (FIXNUM_ZERO_P(y)) return x; return rb_float_plus(x, y); } else if (RB_TYPE_P(x, T_RATIONAL) && - UNLIKELY(rb_method_basic_definition_p(rb_cRational, idPLUS))) { + LIKELY(rb_method_basic_definition_p(rb_cRational, idPLUS))) { if (FIXNUM_ZERO_P(y)) return x; return rb_rational_plus(x, y); @@ -124,7 +124,7 @@ inline static VALUE f_mul(VALUE x, VALUE y) { if (RB_INTEGER_TYPE_P(x) && - UNLIKELY(rb_method_basic_definition_p(rb_cInteger, idMULT))) { + LIKELY(rb_method_basic_definition_p(rb_cInteger, idMULT))) { if (FIXNUM_ZERO_P(y)) return ZERO; if (FIXNUM_ZERO_P(x) && RB_INTEGER_TYPE_P(y)) @@ -134,16 +134,16 @@ f_mul(VALUE x, VALUE y) return rb_int_mul(x, y); } else if (RB_FLOAT_TYPE_P(x) && - UNLIKELY(rb_method_basic_definition_p(rb_cFloat, idMULT))) { + LIKELY(rb_method_basic_definition_p(rb_cFloat, idMULT))) { if (y == ONE) return x; return rb_float_mul(x, y); } else if (RB_TYPE_P(x, T_RATIONAL) && - UNLIKELY(rb_method_basic_definition_p(rb_cRational, idMULT))) { + LIKELY(rb_method_basic_definition_p(rb_cRational, idMULT))) { if (y == ONE) return x; return rb_rational_mul(x, y); } - else if (UNLIKELY(rb_method_basic_definition_p(CLASS_OF(x), idMULT))) { + else if (LIKELY(rb_method_basic_definition_p(CLASS_OF(x), idMULT))) { if (y == ONE) return x; } return rb_funcall(x, '*', 1, y); @@ -153,7 +153,7 @@ inline static VALUE f_sub(VALUE x, VALUE y) { if (FIXNUM_ZERO_P(y) && - UNLIKELY(rb_method_basic_definition_p(CLASS_OF(x), idMINUS))) { + LIKELY(rb_method_basic_definition_p(CLASS_OF(x), idMINUS))) { return x; } return rb_funcall(x, '-', 1, y);