summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-05 06:15:28 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-05 06:15:28 +0000
commitff18933b72bbe2a232bb8a96877364e836dd8465 (patch)
tree288f5b49e07249feb184b6fc0667cae5eccade49 /enum.c
parent88c85c88175183a3f8fd6b20e4024b1eda42cb86 (diff)
rename functions and clean parameters.
* internal.h (rb_yield_lambda): rename to rb_yield_force_blockarg() because this function prohibt lambda arg setup (strict setup). * vm.c (invoke_iseq_block_from_c): remove splattable argument because it is not used. * vm.c (invoke_block_from_c_splattable): rename to invoke_block_from_c_bh() because `splattable` doesn't make sense on current this function. Also accept `force_blockarg' parameter instead of `splattable` parameter. It is more clear. * vm.c (invoke_block_from_c_unsplattable): rename to invoke_block_from_c_proc() and accept `proc` instead of `block'. This function is used only by proc block invocation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/enum.c b/enum.c
index 362c706235..cd77d9ca7a 100644
--- a/enum.c
+++ b/enum.c
@@ -43,7 +43,7 @@ static VALUE
enum_yield(int argc, VALUE ary)
{
if (argc > 1)
- return rb_yield_lambda(ary);
+ return rb_yield_force_blockarg(ary);
if (argc == 1)
return rb_yield(ary);
return rb_yield_values2(0, 0);
@@ -55,7 +55,7 @@ enum_yield_array(VALUE ary)
long len = RARRAY_LEN(ary);
if (len > 1)
- return rb_yield_lambda(ary);
+ return rb_yield_force_blockarg(ary);
if (len == 1)
return rb_yield(RARRAY_AREF(ary, 0));
return rb_yield_values2(0, 0);