Simplified `mrb_obj_instance_eval`; ref #4973

parent c181d89c
...@@ -730,19 +730,8 @@ mrb_obj_instance_eval(mrb_state *mrb, mrb_value self) ...@@ -730,19 +730,8 @@ mrb_obj_instance_eval(mrb_state *mrb, mrb_value self)
if (mrb_get_args(mrb, "|S&", &a, &b) == 1) { if (mrb_get_args(mrb, "|S&", &a, &b) == 1) {
mrb_raise(mrb, E_NOTIMP_ERROR, "instance_eval with string not implemented"); mrb_raise(mrb, E_NOTIMP_ERROR, "instance_eval with string not implemented");
} }
switch (mrb_type(self)) {
case MRB_TT_SYMBOL:
case MRB_TT_FIXNUM:
#ifndef MRB_WITHOUT_FLOAT
case MRB_TT_FLOAT:
#endif
c = 0;
break;
default:
cv = mrb_singleton_class(mrb, self); cv = mrb_singleton_class(mrb, self);
c = mrb_class_ptr(cv); c = mrb_class_ptr(cv);
break;
}
return eval_under(mrb, self, b, c); return eval_under(mrb, self, b, c);
} }
......
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