Project

General

Profile

Bug #1198 » with_index-incompat.patch

knu (Akinori MUSHA), 02/24/2009 07:54 PM

View differences:

src/ruby/trunk/enumerator.c (working copy)
}
static VALUE
enumerator_with_index_i(VALUE val, VALUE *memo)
enumerator_with_index_i(VALUE val, VALUE *memo, int argc, VALUE *argv)
{
val = rb_yield_values(2, val, INT2FIX(*memo));
VALUE ary;
ary = rb_ary_push(rb_ary_new4(argc, argv), INT2FIX(*memo));
++*memo;
return val;
return rb_yield_values2(RARRAY_LEN(ary), RARRAY_PTR(ary));
}
/*
(2-2/2)