aboutsummaryrefslogtreecommitdiffstats
path: root/array.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-11 03:44:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-11 03:44:52 +0000
commit153fa2565858eeac7a757c655b2e55ae01106859 (patch)
treece768032b04cd7fbf1d0da93de19ec3ac3e40870 /array.c
parent48d5eb3d406a46beb53069f1060ae385a23a897b (diff)
downloadruby-153fa2565858eeac7a757c655b2e55ae01106859.tar.gz
array.c: maybe shared array
* 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/trunk@45562 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 1112a22238..0c8a7675c0 100644
--- a/array.c
+++ b/array.c
@@ -905,19 +905,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_ASET(ary, idx, item);
- ARY_SET_LEN(ary, idx + 1);
- return ary;
-}
-
VALUE
rb_ary_cat(VALUE ary, const VALUE *ptr, long len)
{
@@ -3084,7 +3071,7 @@ ary_reject(VALUE orig, VALUE result)
for (i = 0; i < RARRAY_LEN(orig); i++) {
VALUE v = RARRAY_AREF(orig, i);
if (!RTEST(rb_yield(v))) {
- rb_ary_push_1(result, v);
+ rb_ary_push(result, v);
}
}
return result;