summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'array.c')
-rw-r--r--array.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/array.c b/array.c
index 79db7d4618..708a4900c0 100644
--- a/array.c
+++ b/array.c
@@ -163,8 +163,8 @@ rb_ary_new4(long n, const VALUE *elts)
ary = rb_ary_new2(n);
if (n > 0 && elts) {
MEMCPY(RARRAY(ary)->ptr, elts, VALUE, n);
+ RARRAY(ary)->len = n;
}
- RARRAY(ary)->len = n;
return ary;
}