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 | 7d12034d81fb99863194940857889178780c8473 (patch) | |
| tree | dab8c85e1cc5b074677ae6f12de23e652d4339b1 /enum.c | |
| parent | fb8020411266ead320c582025718ffb9c77fcbcb (diff) | |
| download | ruby-7d12034d81fb99863194940857889178780c8473.tar.gz ruby-7d12034d81fb99863194940857889178780c8473.tar.xz ruby-7d12034d81fb99863194940857889178780c8473.zip | |
* 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: http://svn.ruby-lang.org/repos/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; |
