summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-08-02 18:01:39 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-08-06 10:15:55 +0900
commitafbbc0a2cb02c6821ba77b0e19d2dbd0957e6cd9 (patch)
treeb0ce38628839964a3be697e46584f185f578c8c1 /mrbgems
parent005ccd9c7ec8e40ec05afd2e461566324e2d6eb6 (diff)
downloadmruby-afbbc0a2cb02c6821ba77b0e19d2dbd0957e6cd9.tar.gz
mruby-afbbc0a2cb02c6821ba77b0e19d2dbd0957e6cd9.zip
Small refactoring.
The macro `RCLASS_SUPER`, `RCLASS_IV_TBL` and `RCLASS_M_TBL` are removed from `include/mruby/class.h`.
Diffstat (limited to 'mrbgems')
-rw-r--r--mrbgems/mruby-struct/src/struct.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mrbgems/mruby-struct/src/struct.c b/mrbgems/mruby-struct/src/struct.c
index adeb09bc1..fe7e73f04 100644
--- a/mrbgems/mruby-struct/src/struct.c
+++ b/mrbgems/mruby-struct/src/struct.c
@@ -24,19 +24,18 @@ struct_class(mrb_state *mrb)
}
static inline mrb_value
-struct_ivar_get(mrb_state *mrb, mrb_value c, mrb_sym id)
+struct_ivar_get(mrb_state *mrb, mrb_value cls, mrb_sym id)
{
- struct RClass* kclass;
+ struct RClass* c = mrb_class_ptr(cls);
struct RClass* sclass = struct_class(mrb);
mrb_value ans;
for (;;) {
- ans = mrb_iv_get(mrb, c, id);
+ ans = mrb_iv_get(mrb, mrb_obj_value(c), id);
if (!mrb_nil_p(ans)) return ans;
- kclass = RCLASS_SUPER(c);
- if (kclass == 0 || kclass == sclass)
+ c = c->super;
+ if (c == sclass || c == 0)
return mrb_nil_value();
- c = mrb_obj_value(kclass);
}
}