diff options
| author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-15 04:25:07 +0000 |
|---|---|---|
| committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-15 04:25:07 +0000 |
| commit | fd06526c1906ca0859776186aec0231607518deb (patch) | |
| tree | cc188dfd428f1b2eae75a6de81c68e2701d60ffc /hash.c | |
| parent | 08d05f0466bb6922d047e8eb1ba9145fc6b55d5d (diff) | |
| download | ruby-fd06526c1906ca0859776186aec0231607518deb.tar.gz ruby-fd06526c1906ca0859776186aec0231607518deb.tar.xz ruby-fd06526c1906ca0859776186aec0231607518deb.zip | |
* hash.c: exchange semantics of Hash#each and Hash#each_pair.
pointed out by [ruby-dev:30997].
* test/ruby/test_iterator.rb: ditto.
* test/ruby/test_yield.rb: ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
| -rw-r--r-- | hash.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -994,7 +994,7 @@ static int each_pair_i(VALUE key, VALUE value) { if (key == Qundef) return ST_CONTINUE; - rb_yield(rb_assoc_new(key, value)); + rb_yield_values(2, key, value); return ST_CONTINUE; } @@ -1027,7 +1027,7 @@ static int each_i(VALUE key, VALUE value) { if (key == Qundef) return ST_CONTINUE; - rb_yield_values(2, key, value); + rb_yield(rb_assoc_new(key, value)); return ST_CONTINUE; } |
