diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-05-31 16:59:12 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-05-31 16:59:12 +0000 |
commit | 3d7439d56829f38226d4fcd3cacb402297488fa4 (patch) | |
tree | dab8c85e1cc5b074677ae6f12de23e652d4339b1 /enum.c | |
parent | 44475bb20874b908160b2a9e6d1dda7fb0c10e88 (diff) |
* enum.c (each_with_index_i): should work well with continuation.
a patch from sheepman <sheepman AT sheepman.sakura.ne.jp>.
[ruby-dev:30846]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r-- | enum.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1167,11 +1167,11 @@ static VALUE each_with_index_i(VALUE val, VALUE memo) { long n; + VALUE idx = RARRAY_PTR(memo)[1]; RARRAY_PTR(memo)[0] = val; rb_yield(memo); - val = RARRAY_PTR(memo)[1]; - n = NUM2LONG(val); + n = NUM2LONG(idx); n++; RARRAY_PTR(memo)[1] = INT2NUM(n); return Qnil; |