diff options
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -1778,8 +1778,7 @@ rb_ary_empty_p(VALUE ary) VALUE rb_ary_dup(VALUE ary) { - VALUE ary_class = rb_obj_class(ary); - VALUE dup = ary_new(ary_class ? ary_class : rb_cArray, RARRAY_LEN(ary)); + VALUE dup = rb_ary_new2(RARRAY_LEN(ary)); MEMCPY(RARRAY_PTR(dup), RARRAY_PTR(ary), VALUE, RARRAY_LEN(ary)); ARY_SET_LEN(dup, RARRAY_LEN(ary)); return dup; |