mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* enum.c (each_with_index_i): use rb_yield_values() for
compatibility with Enumerator#with_index(). a patch from Yusuke ENDOH <mame AT tsg.ne.jp>. [ruby-dev:32195] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
364f0bfe9f
commit
c23d672932
2 changed files with 7 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Fri Nov 9 13:57:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* enum.c (each_with_index_i): use rb_yield_values() for
|
||||||
|
compatibility with Enumerator#with_index(). a patch from Yusuke
|
||||||
|
ENDOH <mame AT tsg.ne.jp>. [ruby-dev:32195]
|
||||||
|
|
||||||
Fri Nov 9 13:45:05 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Fri Nov 9 13:45:05 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* test/ruby/test_iterator.rb (TestIterator::IterTest::each):
|
* test/ruby/test_iterator.rb (TestIterator::IterTest::each):
|
||||||
|
|
2
enum.c
2
enum.c
|
@ -1295,7 +1295,7 @@ each_with_index_i(VALUE val, VALUE memo)
|
||||||
{
|
{
|
||||||
long n = (*(VALUE *)memo)++;
|
long n = (*(VALUE *)memo)++;
|
||||||
|
|
||||||
return rb_yield(rb_ary_new3(2, val, INT2NUM(n)));
|
return rb_yield_values(2, val, INT2NUM(n));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue