summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 3c0aeab2b8..6e1c247ba4 100644
--- a/hash.c
+++ b/hash.c
@@ -575,6 +575,7 @@ static VALUE
rb_hash_become(hash, hash2)
VALUE hash, hash2;
{
+ if (hash == hash2) return hash;
hash2 = to_hash(hash2);
rb_hash_clear(hash);
st_foreach(RHASH(hash2)->tbl, replace_i, hash);