summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-27 02:52:49 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-27 02:52:49 +0000
commit05ebc662fb6e5fc95046714c6c638ffc0016023e (patch)
tree65e06886703ef32d52ffc89118105eed54168589 /array.c
parent77443b2882081392f63bffa2be0f65aac21c2a8d (diff)
merge revision(s) 45562: [Backport #9727]
* array.c (ary_reject): may be turned into a shared array during the given block. [ruby-dev:48101] [Bug #9727] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@46155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/array.c b/array.c
index 9f900ba305..edf40c9ee1 100644
--- a/array.c
+++ b/array.c
@@ -829,19 +829,6 @@ rb_ary_push(VALUE ary, VALUE item)
return ary;
}
-static VALUE
-rb_ary_push_1(VALUE ary, VALUE item)
-{
- long idx = RARRAY_LEN(ary);
-
- if (idx >= ARY_CAPA(ary)) {
- ary_double_capa(ary, idx);
- }
- RARRAY_PTR(ary)[idx] = item;
- ARY_SET_LEN(ary, idx + 1);
- return ary;
-}
-
VALUE
rb_ary_cat(VALUE ary, const VALUE *ptr, long len)
{
@@ -2931,7 +2918,7 @@ ary_reject(VALUE orig, VALUE result)
for (i = 0; i < RARRAY_LEN(orig); i++) {
VALUE v = RARRAY_PTR(orig)[i];
if (!RTEST(rb_yield(v))) {
- rb_ary_push_1(result, v);
+ rb_ary_push(result, v);
}
}
return result;