Skip `mrb_get_args()` in `mrb_ary_push()`.

parent 6db0162e
...@@ -508,19 +508,21 @@ mrb_ary_push(mrb_state *mrb, mrb_value ary, mrb_value elem) ...@@ -508,19 +508,21 @@ mrb_ary_push(mrb_state *mrb, mrb_value ary, mrb_value elem)
static mrb_value static mrb_value
mrb_ary_push_m(mrb_state *mrb, mrb_value self) mrb_ary_push_m(mrb_state *mrb, mrb_value self)
{ {
mrb_int argc;
mrb_value *argv; mrb_value *argv;
mrb_int len, len2, alen; mrb_int len, len2;
struct RArray *a; struct RArray *a;
mrb_get_args(mrb, "*!", &argv, &alen); argc = mrb_get_argc(mrb);
argv = mrb_get_argv(mrb);
a = mrb_ary_ptr(self); a = mrb_ary_ptr(self);
ary_modify(mrb, a); ary_modify(mrb, a);
len = ARY_LEN(a); len = ARY_LEN(a);
len2 = len + alen; len2 = len + argc;
if (ARY_CAPA(a) < len2) { if (ARY_CAPA(a) < len2) {
ary_expand_capa(mrb, a, len2); ary_expand_capa(mrb, a, len2);
} }
array_copy(ARY_PTR(a)+len, argv, alen); array_copy(ARY_PTR(a)+len, argv, argc);
ARY_SET_LEN(a, len2); ARY_SET_LEN(a, len2);
while (alen--) { while (alen--) {
mrb_field_write_barrier_value(mrb, (struct RBasic*)a, *argv); mrb_field_write_barrier_value(mrb, (struct RBasic*)a, *argv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment