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 | afb1901848f9b6998f320423474e830a1e95d780 (patch) | |
tree | cc188dfd428f1b2eae75a6de81c68e2701d60ffc /hash.c | |
parent | 7307d38c4fb5c6943bab8859e178d2d28769a64c (diff) | |
download | ruby-afb1901848f9b6998f320423474e830a1e95d780.tar.gz |
* 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: svn+ssh://ci.ruby-lang.org/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; } |