aboutsummaryrefslogtreecommitdiffstats
path: root/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'array.c')
-rw-r--r--array.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/array.c b/array.c
index 8e24da2ce6..e21c01194c 100644
--- a/array.c
+++ b/array.c
@@ -515,11 +515,11 @@ VALUE
}
VALUE
-rb_ary_new_from_values(long n, const VALUE *elts)
+rb_ary_tmp_new_from_values(VALUE klass, long n, const VALUE *elts)
{
VALUE ary;
- ary = rb_ary_new2(n);
+ ary = ary_new(klass, n);
if (n > 0 && elts) {
ary_memcpy(ary, 0, n, elts);
ARY_SET_LEN(ary, n);
@@ -529,6 +529,12 @@ rb_ary_new_from_values(long n, const VALUE *elts)
}
VALUE
+rb_ary_new_from_values(long n, const VALUE *elts)
+{
+ return rb_ary_tmp_new_from_values(rb_cArray, n, elts);
+}
+
+VALUE
rb_ary_tmp_new(long capa)
{
return ary_new(0, capa);