mruby-array-ext/array.c (mrb_ary_values_at): avoid mrb_get_args().

If your function doesn't call VM recursively, you can use mrb_get_argv()
instead of mrb_get_args(mrb, "*", ...).
This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-10-20 19:07:25 +09:00
parent da8ef29fba
commit c27ae4337d
+2 -4
View File
@@ -104,10 +104,8 @@ ary_ref(mrb_state *mrb, mrb_value ary, mrb_int n)
static mrb_value
mrb_ary_values_at(mrb_state *mrb, mrb_value self)
{
mrb_int argc;
const mrb_value *argv;
mrb_get_args(mrb, "*", &argv, &argc);
mrb_int argc = mrb_get_argc(mrb);
const mrb_value *argv = mrb_get_argv(mrb);
return mrb_get_values_at(mrb, self, RARRAY_LEN(self), argc, argv, ary_ref);
}