From 5617de0071ccb59e7d5b40deb61c343ac6cf8e80 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 3 Nov 2022 23:38:27 +0900 Subject: [PATCH] mruby-method/method.c (method_eql): do not check `_klass` for equality. --- mrbgems/mruby-method/src/method.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/mrbgems/mruby-method/src/method.c b/mrbgems/mruby-method/src/method.c index 18560d159..b2eb4ef07 100644 --- a/mrbgems/mruby-method/src/method.c +++ b/mrbgems/mruby-method/src/method.c @@ -187,7 +187,7 @@ method_eql(mrb_state *mrb, mrb_value self) { mrb_value other = mrb_get_arg1(mrb); mrb_value receiver, orig_proc, other_proc; - struct RClass *owner, *klass; + struct RClass *owner; struct RProc *orig_rproc, *other_rproc; if (!mrb_obj_is_instance_of(mrb, other, mrb_class(mrb, self))) @@ -196,10 +196,6 @@ method_eql(mrb_state *mrb, mrb_value self) if (mrb_class(mrb, self) != mrb_class(mrb, other)) return mrb_false_value(); - klass = mrb_class_ptr(IV_GET(self, MRB_SYM(_klass))); - if (klass != mrb_class_ptr(IV_GET(other, MRB_SYM(_klass)))) - return mrb_false_value(); - owner = mrb_class_ptr(IV_GET(self, MRB_SYM(_owner))); if (owner != mrb_class_ptr(IV_GET(other, MRB_SYM(_owner)))) return mrb_false_value(); @@ -217,10 +213,8 @@ method_eql(mrb_state *mrb, mrb_value self) return mrb_false_value(); } - if (mrb_nil_p(orig_proc)) - return mrb_false_value(); - if (mrb_nil_p(other_proc)) - return mrb_false_value(); + if (mrb_nil_p(orig_proc)) return mrb_false_value(); + if (mrb_nil_p(other_proc)) return mrb_false_value(); orig_rproc = mrb_proc_ptr(orig_proc); other_rproc = mrb_proc_ptr(other_proc);