diff options
author | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-08 04:53:06 +0000 |
---|---|---|
committer | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-08 04:53:06 +0000 |
commit | bbd1e83e5aa15f2f5fd3afa569de04bbd9c21eec (patch) | |
tree | 01eded1f453a23ed6010393696562de52246a2ba /complex.c | |
parent | 1e87935958c0afc9e953079e99eb628865e55820 (diff) |
complex.c: replace misused UNLIKELY with LIKELY
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'complex.c')
-rw-r--r-- | complex.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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); |