summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-03-23 08:37:35 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-03-23 08:37:35 +0000
commit688169fd83b24564b653c03977c168cea50ccd35 (patch)
treeb4724e5397cf5da5b554ab5795842a93145a88be /hash.c
parent5c13dd59db1ee6c04cdac4ce2ee97d5934115439 (diff)
2000-03-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hash.c b/hash.c
index 47681b2117..7d8668b0c3 100644
--- a/hash.c
+++ b/hash.c
@@ -411,10 +411,11 @@ rb_hash_delete(hash, key)
VALUE val;
rb_hash_modify(hash);
- if (RHASH(hash)->iter_lev > 0 &&
- st_delete_safe(RHASH(hash)->tbl, &key, &val, Qundef)) {
- FL_SET(hash, HASH_DELETED);
- return val;
+ if (RHASH(hash)->iter_lev > 0) {
+ if (st_delete_safe(RHASH(hash)->tbl, &key, &val, Qundef)) {
+ FL_SET(hash, HASH_DELETED);
+ return val;
+ }
}
else if (st_delete(RHASH(hash)->tbl, &key, &val))
return val;