aboutsummaryrefslogtreecommitdiffstats
path: root/proc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-05 07:18:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-05 07:18:14 +0000
commit4de3979f96119c3da170afc678d6df5bf4f3b7ba (patch)
tree4fe58bc1417e12a05587444c6e79e3d7dee98499 /proc.c
parentb01514cd2afb62c0393d2fa6b0653153e1aaeb4d (diff)
downloadruby-4de3979f96119c3da170afc678d6df5bf4f3b7ba.tar.gz
proc.c: no unnecessary temporary array
* proc.c (bmcall): get rid of making temporary single element array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/proc.c b/proc.c
index 9bef504815..570cbcbc64 100644
--- a/proc.c
+++ b/proc.c
@@ -2533,12 +2533,9 @@ bmcall(VALUE args, VALUE method, int argc, VALUE *argv, VALUE passed_proc)
VALUE ret;
if (CLASS_OF(args) != rb_cArray) {
- args = rb_ary_new3(1, args);
- argc = 1;
- }
- else {
- argc = check_argc(RARRAY_LEN(args));
+ return rb_method_call_with_block(1, &args, method, passed_proc);
}
+ argc = check_argc(RARRAY_LEN(args));
ret = rb_method_call_with_block(argc, RARRAY_PTR(args), method, passed_proc);
RB_GC_GUARD(a) = args;
return ret;