summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-20 12:31:26 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-20 12:31:26 +0000
commitae8dc9b72204679e78d6993f5cef8c5189b8b8d8 (patch)
tree833953f9dc255870f6cfa9d83cfa191459a70daf /enumerator.c
parent0208837f083422a68ff5df14d34fb1e4bcb82d2c (diff)
* vm_eval.c (rb_iterate): pass current block when the argument bl_proc
is NULL. This behavior can be used to make enumerator faster [ruby-dev:39874] * enumerator.c (enumerator_each): pass current block directly instead of trampoline block (enumerator_each_i). * io.c (argf_each_line, argf_each_byte, argf_each_char): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/enumerator.c b/enumerator.c
index 7c50f3dda2..34d16c057e 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -330,12 +330,6 @@ enumerator_allocate(VALUE klass)
}
static VALUE
-enumerator_each_i(VALUE v, VALUE enum_obj, int argc, VALUE *argv)
-{
- return rb_yield_values2(argc, argv);
-}
-
-static VALUE
enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, VALUE *argv)
{
struct enumerator *ptr;
@@ -473,7 +467,7 @@ static VALUE
enumerator_each(VALUE obj)
{
if (!rb_block_given_p()) return obj;
- return enumerator_block_call(obj, enumerator_each_i, obj);
+ return enumerator_block_call(obj, 0, obj);
}
static VALUE