summaryrefslogtreecommitdiffstats
path: root/enum.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-22 08:09:58 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-22 08:09:58 +0000
commitce9aba02a65a2a34f9c682635a4ccb5c3077b862 (patch)
treefa6ca2b3d705a9ea9ea67442b20c2e432dc647d6 /enum.c
parentb2da7a3f81a5aacb3a2c725aad2b7397ea721cd5 (diff)
downloadruby-ce9aba02a65a2a34f9c682635a4ccb5c3077b862.tar.gz
ruby-ce9aba02a65a2a34f9c682635a4ccb5c3077b862.tar.xz
ruby-ce9aba02a65a2a34f9c682635a4ccb5c3077b862.zip
* enum.c (inject_i): use rb_yield_values.
* enum.c (each_with_index_i): ditto. * eval.c (rb_yield_splat): new function to call "yield *values". * string.c (rb_str_scan): use rb_yield_splat(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4424 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 71b2e7e76..ac27757bd 100644
--- a/enum.c
+++ b/enum.c
@@ -187,7 +187,7 @@ inject_i(i, memo)
memo->u1.value = i;
}
else {
- memo->u1.value = rb_yield(rb_assoc_new(memo->u1.value, i));
+ memo->u1.value = rb_yield_values(2, memo->u1.value, i);
}
return Qnil;
}
@@ -499,7 +499,7 @@ each_with_index_i(val, memo)
VALUE val;
NODE *memo;
{
- rb_yield(rb_assoc_new(val, INT2FIX(memo->u3.cnt)));
+ rb_yield_values(val, INT2FIX(memo->u3.cnt));
memo->u3.cnt++;
return Qnil;
}