mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
refactor mrb_vm_cv_get
This commit is contained in:
+2
-11
@@ -701,17 +701,8 @@ mrb_vm_cv_get(mrb_state *mrb, mrb_sym sym)
|
||||
struct RClass *c = mrb->ci->proc->target_class;
|
||||
|
||||
if (!c) c = mrb->ci->target_class;
|
||||
while (c) {
|
||||
if (c->iv) {
|
||||
iv_tbl *t = c->iv;
|
||||
mrb_value v;
|
||||
|
||||
if (iv_get(mrb, t, sym, &v))
|
||||
return v;
|
||||
}
|
||||
c = c->super;
|
||||
}
|
||||
return mrb_nil_value();
|
||||
|
||||
return mrb_mod_cv_get(mrb, c, sym);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user