summaryrefslogtreecommitdiffstats
path: root/enum.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-09 04:59:07 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-09 04:59:07 +0000
commit11d5b7bae0021700d9b47afd42aa0c7aeee16beb (patch)
treecf522e8aa66bc3567038ebe0aad5724ff5c6a353 /enum.c
parent17e061bf2cecddb531df0c8c81ccb381a07bf04b (diff)
downloadruby-11d5b7bae0021700d9b47afd42aa0c7aeee16beb.tar.gz
ruby-11d5b7bae0021700d9b47afd42aa0c7aeee16beb.tar.xz
ruby-11d5b7bae0021700d9b47afd42aa0c7aeee16beb.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@13850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/enum.c b/enum.c
index 096772dd2..b778bfea8 100644
--- a/enum.c
+++ b/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));
}
/*