kernel.c (mrb_cmp_m): use mrb_equal instead of mrb_obj_equal.

`Kernel#<=>` should also call `#==` to check if the objects are equal.
This commit is contained in:
fn ⌃ ⌥
2022-10-27 07:43:56 -07:00
parent 63c0abeabd
commit 55c423fc55
+1 -1
View File
@@ -83,7 +83,7 @@ mrb_cmp_m(mrb_state *mrb, mrb_value self)
{
mrb_value arg = mrb_get_arg1(mrb);
if (mrb_obj_equal(mrb, self, arg))
if (mrb_equal(mrb, self, arg))
return mrb_fixnum_value(0);
return mrb_nil_value();
}