diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-10-17 15:22:45 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-10-17 15:22:45 +0900 |
| commit | b890528a183caf2f4161983a147508f65af8c700 (patch) | |
| tree | 0f3101a78c9bb3c2d6b224cc64d28e4d307c71d4 | |
| parent | 344a7ce20c5e59a07fec65732f56d232eca8eef0 (diff) | |
| download | mruby-b890528a183caf2f4161983a147508f65af8c700.tar.gz mruby-b890528a183caf2f4161983a147508f65af8c700.zip | |
Remove `mrb_vm_get_argc`; ref #3826
| -rw-r--r-- | include/mruby.h | 7 | ||||
| -rw-r--r-- | src/class.c | 5 |
2 files changed, 3 insertions, 9 deletions
diff --git a/include/mruby.h b/include/mruby.h index 54ba0ead4..5c5a631e2 100644 --- a/include/mruby.h +++ b/include/mruby.h @@ -858,13 +858,6 @@ mrb_get_mid(mrb_state *mrb) /* get method symbol */ return mrb->c->ci->mid; } -/* returns -1 for *splat arguments */ -static inline mrb_int -mrb_vm_get_argc(mrb_state *mrb) /* get argc */ -{ - return mrb->c->ci->argc; -} - /** * Retrieve number of arguments from mrb_state. * diff --git a/src/class.c b/src/class.c index 506f540af..df645792c 100644 --- a/src/class.c +++ b/src/class.c @@ -535,7 +535,8 @@ to_sym(mrb_state *mrb, mrb_value ss) MRB_API mrb_int mrb_get_argc(mrb_state *mrb) { - mrb_int argc = mrb_vm_get_argc(mrb); + mrb_int argc = mrb->c->ci->argc; + if (argc < 0) { struct RArray *a = mrb_ary_ptr(mrb->c->stack[1]); @@ -547,7 +548,7 @@ mrb_get_argc(mrb_state *mrb) MRB_API mrb_value* mrb_get_argv(mrb_state *mrb) { - mrb_int argc = mrb_vm_get_argc(mrb); + mrb_int argc = mrb->c->ci->argc; mrb_value *array_argv; if (argc < 0) { struct RArray *a = mrb_ary_ptr(mrb->c->stack[1]); |
