summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-08 10:58:35 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-08 10:58:35 +0000
commit450a515e959d2a35d6e1a59bad0a83db2a7698da (patch)
tree82783e60535f9e4e5d8e6a1d5d6cb19541f035af /array.c
parent98932f5150c2e6e26976c9e20b34d79c645e6593 (diff)
* array.c (rb_ary_dup): reverted r39004. see [Bug #7768], and the
release manager finailly decided to revert it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/array.c b/array.c
index b4216ac1d0..a7c74a2aa4 100644
--- a/array.c
+++ b/array.c
@@ -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;