summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-28 04:21:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-28 04:21:31 +0000
commit0504f8a199c525cf47037de8f5b25979665482cb (patch)
tree494addc0fd35877a3d10f9ef20862865b1a175e4 /hash.c
parenta532b58bdec058c330a177b5925c2b813bbde541 (diff)
downloadruby-0504f8a199c525cf47037de8f5b25979665482cb.tar.gz
ruby-0504f8a199c525cf47037de8f5b25979665482cb.tar.xz
ruby-0504f8a199c525cf47037de8f5b25979665482cb.zip
* hash.c (rb_hash_become): should check self-assignment after
conversion. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index 6e1c247ba..69ca1db4e 100644
--- a/hash.c
+++ b/hash.c
@@ -575,8 +575,8 @@ static VALUE
rb_hash_become(hash, hash2)
VALUE hash, hash2;
{
- if (hash == hash2) return hash;
hash2 = to_hash(hash2);
+ if (hash == hash2) return hash;
rb_hash_clear(hash);
st_foreach(RHASH(hash2)->tbl, replace_i, hash);
RHASH(hash)->ifnone = RHASH(hash2)->ifnone;