summaryrefslogtreecommitdiffhomepage
path: root/src/variable.c
diff options
context:
space:
mode:
authorKouichi Nakanishi <[email protected]>2017-04-12 23:25:22 +0900
committerKouichi Nakanishi <[email protected]>2017-04-12 23:27:09 +0900
commitd4205c9b20e7ac0017d80314ec65c906308f04c9 (patch)
treefa7315750b9e83ba4d11b40594e12e31a6d2c728 /src/variable.c
parent4fca570a742f7f1dae7830410a16998f34342c4c (diff)
downloadmruby-d4205c9b20e7ac0017d80314ec65c906308f04c9.tar.gz
mruby-d4205c9b20e7ac0017d80314ec65c906308f04c9.zip
Use while statement instead of for statement
Diffstat (limited to 'src/variable.c')
-rw-r--r--src/variable.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/variable.c b/src/variable.c
index 5e007c9fa..ffe8b954b 100644
--- a/src/variable.c
+++ b/src/variable.c
@@ -953,7 +953,8 @@ mrb_vm_const_get(mrb_state *mrb, mrb_sym sym)
if (c->iv && iv_get(mrb, c->iv, sym, &v)) {
return v;
}
- for (c2 = c; c2 && c2->tt == MRB_TT_SCLASS;) {
+ c2 = c;
+ while (c2 && c2->tt == MRB_TT_SCLASS) {
mrb_value klass;
klass = mrb_obj_iv_get(mrb, (struct RObject *)c2,
mrb_intern_lit(mrb, "__attached__"));