summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-24 04:34:26 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-24 04:34:26 +0000
commit8b1de0b1ad49733abeddd8be359ae816b29de59a (patch)
treea7ed03dd3f6442635f694c4367bcd94be57f6dbd /hash.c
parent24b9bdca25dc431aff935df7739b9c5ea0ee4077 (diff)
2000-05-24
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hash.c b/hash.c
index dc8bdf5..e66ab12 100644
--- a/hash.c
+++ b/hash.c
@@ -334,7 +334,7 @@ rb_hash_fetch(argc, argv, hash)
rb_scan_args(argc, argv, "11", &key, &if_none);
if (!st_lookup(RHASH(hash)->tbl, key, &val)) {
- if (rb_iterator_p()) {
+ if (rb_block_given_p()) {
if (argc > 1) {
rb_raise(rb_eArgError, "wrong # of arguments", argc);
}
@@ -421,7 +421,7 @@ rb_hash_delete(hash, key)
}
else if (st_delete(RHASH(hash)->tbl, &key, &val))
return val;
- if (rb_iterator_p()) {
+ if (rb_block_given_p()) {
return rb_yield(key);
}
return RHASH(hash)->ifnone;
@@ -894,7 +894,7 @@ env_delete_m(obj, name)
VALUE obj, name;
{
VALUE val = env_delete(obj, name);
- if (rb_iterator_p()) rb_yield(name);
+ if (rb_block_given_p()) rb_yield(name);
return val;
}
@@ -934,7 +934,7 @@ env_fetch(argc, argv)
}
env = getenv(nam);
if (!env) {
- if (rb_iterator_p()) {
+ if (rb_block_given_p()) {
if (argc > 1) {
rb_raise(rb_eArgError, "wrong # of arguments", argc);
}