`mrb_obj_respond_to` to use `mrb_method_search_vm`.

parent 0d865a77
......@@ -1563,25 +1563,13 @@ mrb_obj_not_equal_m(mrb_state *mrb, mrb_value self)
MRB_API mrb_bool
mrb_obj_respond_to(mrb_state *mrb, struct RClass* c, mrb_sym mid)
{
khiter_t k;
while (c) {
khash_t(mt) *h = c->mt;
struct RProc *m;
if (h) {
k = kh_get(mt, mrb, h, mid);
if (k != kh_end(h)) {
if (kh_value(h, k)) {
return TRUE; /* method exists */
}
else {
return FALSE; /* undefined method */
}
}
}
c = c->super;
m = mrb_method_search_vm(mrb, &c, mid);
if (!m) {
return FALSE;
}
return FALSE; /* no method */
return TRUE;
}
MRB_API mrb_bool
......
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