summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-15 04:25:07 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-15 04:25:07 +0000
commitafb1901848f9b6998f320423474e830a1e95d780 (patch)
treecc188dfd428f1b2eae75a6de81c68e2701d60ffc /hash.c
parent7307d38c4fb5c6943bab8859e178d2d28769a64c (diff)
* 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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hash.c b/hash.c
index 3f27a0c633..d349a375c6 100644
--- a/hash.c
+++ b/hash.c
@@ -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;
}