aboutsummaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-01 09:38:30 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-01 09:38:30 +0000
commit23f89a8932d8941d0d64308dec1e324dba8d7113 (patch)
treea05fb2a18ab1ee956fce60179209c5088a70d672 /hash.c
parentda548b67f5edc5f876ec5e8a21c491963d2bd670 (diff)
downloadruby-23f89a8932d8941d0d64308dec1e324dba8d7113.tar.gz
* hash.c (replace_i): ignore when key == Qundef.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index 7a08b0d500..2d99df3ce0 100644
--- a/hash.c
+++ b/hash.c
@@ -510,7 +510,10 @@ static int
replace_i(key, val, hash)
VALUE key, val, hash;
{
- rb_hash_aset(hash, key, val);
+ if (key != Qundef) {
+ rb_hash_aset(hash, key, val);
+ }
+
return ST_CONTINUE;
}