mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
This commit is contained in:
+2
-9
@@ -177,10 +177,7 @@ mrb_ary_concat_m(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
mrb_value other;
|
||||
|
||||
mrb_get_args(mrb, "o", &other);
|
||||
if (mrb_type(other) != MRB_TT_ARRAY) {
|
||||
mrb_raise(mrb, E_ARGUMENT_ERROR, "expected Array");
|
||||
}
|
||||
mrb_get_args(mrb, "A", &other);
|
||||
mrb_ary_concat(mrb, self, other);
|
||||
return self;
|
||||
}
|
||||
@@ -193,11 +190,7 @@ mrb_ary_plus(mrb_state *mrb, mrb_value self)
|
||||
mrb_value other;
|
||||
mrb_value ary;
|
||||
|
||||
mrb_get_args(mrb, "o", &other);
|
||||
if (mrb_type(other) != MRB_TT_ARRAY) {
|
||||
mrb_raise(mrb, E_ARGUMENT_ERROR, "expected Array");
|
||||
}
|
||||
|
||||
mrb_get_args(mrb, "A", &other);
|
||||
ary = mrb_ary_new_capa(mrb, a1->len + RARRAY_LEN(other));
|
||||
a2 = mrb_ary_ptr(ary);
|
||||
memcpy(a2->buf, a1->buf, sizeof(mrb_value)*a1->len);
|
||||
|
||||
Reference in New Issue
Block a user