summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-06-03 02:19:12 +0900
committerYukihiro Matsumoto <[email protected]>2012-06-03 02:19:12 +0900
commit5fcd520514095fa9bbb31d2e7eca192b1be7dfc2 (patch)
tree21a221be6067c374e192b2ac900478b458a0d5f6 /src
parent369b556d04b003e976b8467d724e1df48042b51c (diff)
downloadmruby-5fcd520514095fa9bbb31d2e7eca192b1be7dfc2.tar.gz
mruby-5fcd520514095fa9bbb31d2e7eca192b1be7dfc2.zip
small refactoring after mruby coding convention
Diffstat (limited to 'src')
-rw-r--r--src/class.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/class.c b/src/class.c
index fa6adaf28..544f36527 100644
--- a/src/class.c
+++ b/src/class.c
@@ -810,13 +810,12 @@ mrb_value
mrb_class_new_class(mrb_state *mrb, mrb_value cv)
{
mrb_value super;
- if(mrb->ci->argc > 0) {
- mrb_get_args(mrb, "o", &super);
- }
- else {
+ struct RClass *new_class;
+
+ if (mrb_get_args(mrb, "|o", &super) == 0) {
super = mrb_obj_value(mrb->object_class);
}
- struct RClass *new_class = mrb_class_new(mrb, mrb_class_ptr(super));
+ new_class = mrb_class_new(mrb, mrb_class_ptr(super));
return mrb_obj_value(new_class);
}