diff options
| author | skandhas <[email protected]> | 2012-12-20 22:29:26 +0800 |
|---|---|---|
| committer | skandhas <[email protected]> | 2012-12-20 22:29:26 +0800 |
| commit | e6a47323b8d67fdf85f095c30b2d66a00d2d2ca5 (patch) | |
| tree | 6d4e2ebcc3332897df0d7abc1a2bca9f8516d566 /src/variable.c | |
| parent | 8026ec039a28f2f71993f97fb8fc60e5b04f1693 (diff) | |
| download | mruby-e6a47323b8d67fdf85f095c30b2d66a00d2d2ca5.tar.gz mruby-e6a47323b8d67fdf85f095c30b2d66a00d2d2ca5.zip | |
refactor mrb_vm_cv_get
Diffstat (limited to 'src/variable.c')
| -rw-r--r-- | src/variable.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/variable.c b/src/variable.c index 816b703bf..147373bd4 100644 --- a/src/variable.c +++ b/src/variable.c @@ -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 |
