Commit 992af98b authored by Masaki Muranaka's avatar Masaki Muranaka

Use mrb_true_or_false_value() / in fix_equal().

parent 698e2815
...@@ -926,19 +926,15 @@ static mrb_value ...@@ -926,19 +926,15 @@ static mrb_value
fix_equal(mrb_state *mrb, mrb_value x) fix_equal(mrb_state *mrb, mrb_value x)
{ {
mrb_value y; mrb_value y;
mrb_bool equal_p;
mrb_get_args(mrb, "o", &y); mrb_get_args(mrb, "o", &y);
if (mrb_obj_equal(mrb, x, y)) return mrb_true_value(); equal_p = mrb_obj_equal(mrb, x, y) ||
switch (mrb_type(y)) { (mrb_type(y) == MRB_TT_FLOAT &&
case MRB_TT_FLOAT: (mrb_float)mrb_fixnum(x) == mrb_float(y));
if ((mrb_float)mrb_fixnum(x) == mrb_float(y))
return mrb_true_value(); return mrb_true_or_false_value(equal_p);
/* fall through */
case MRB_TT_FIXNUM:
default:
return mrb_false_value();
}
} }
/* 15.2.8.3.8 */ /* 15.2.8.3.8 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment