summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-03 22:44:45 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-03 22:44:45 +0000
commit9315bc11674a764db4f54c56c3ac5155d4edd1a3 (patch)
tree68f70f724a49ab45cbfabe08cb0c635393a13948 /hash.c
parenta76e2021d00939bad0a18309539d2a48974a44d1 (diff)
downloadruby-9315bc11674a764db4f54c56c3ac5155d4edd1a3.tar.gz
ruby-9315bc11674a764db4f54c56c3ac5155d4edd1a3.tar.xz
ruby-9315bc11674a764db4f54c56c3ac5155d4edd1a3.zip
* hash.c (rb_hash_replace): should copy compare_by_identity status as well.
[ruby-core:24728] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 74b654ee1..ce8af6c6d 100644
--- a/hash.c
+++ b/hash.c
@@ -1060,6 +1060,10 @@ rb_hash_replace(VALUE hash, VALUE hash2)
hash2 = to_hash(hash2);
if (hash == hash2) return hash;
rb_hash_clear(hash);
+ if (RHASH(hash2)->ntbl) {
+ rb_hash_tbl(hash);
+ RHASH(hash)->ntbl->type = RHASH(hash2)->ntbl->type;
+ }
rb_hash_foreach(hash2, replace_i, hash);
RHASH(hash)->ifnone = RHASH(hash2)->ifnone;
if (FL_TEST(hash2, HASH_PROC_DEFAULT)) {