зеркало из https://github.com/github/ruby.git
* 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:
Родитель
364f0bfe9f
Коммит
c23d672932
|
@ -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>
|
||||
|
||||
* 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)++;
|
||||
|
||||
return rb_yield(rb_ary_new3(2, val, INT2NUM(n)));
|
||||
return rb_yield_values(2, val, INT2NUM(n));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче