summaryrefslogtreecommitdiffhomepage
path: root/src/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/array.c')
-rw-r--r--src/array.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/array.c b/src/array.c
index e039ba3b1..bfa6e5f06 100644
--- a/src/array.c
+++ b/src/array.c
@@ -684,11 +684,7 @@ mrb_ary_set(mrb_state *mrb, mrb_value ary, mrb_int n, mrb_value val)
static struct RArray*
ary_dup(mrb_state *mrb, struct RArray *a)
{
- mrb_int len = ARY_LEN(a);
- struct RArray *d = ary_new_capa(mrb, len);
-
- ary_replace(mrb, d, a);
- return d;
+ return ary_new_from_values(mrb, ARY_LEN(a), ARY_PTR(a));
}
MRB_API mrb_value