[前][次][番号順一覧][スレッド一覧]

ruby-changes:12667

From: matz <ko1@a...>
Date: Tue, 4 Aug 2009 07:45:06 +0900 (JST)
Subject: [ruby-changes:12667] Ruby:r24382 (trunk): * hash.c (rb_hash_replace): should copy compare_by_identity status as well.

matz	2009-08-04 07:44:45 +0900 (Tue, 04 Aug 2009)

  New Revision: 24382

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24382

  Log:
    * hash.c (rb_hash_replace): should copy compare_by_identity status as well.
      [ruby-core:24728]

  Modified files:
    trunk/ChangeLog
    trunk/hash.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 24381)
+++ ChangeLog	(revision 24382)
@@ -1,3 +1,8 @@
+Tue Aug  4 06:30:01 2009  Yukihiro Matsumoto  <matz@r...>
+
+	* hash.c (rb_hash_replace): should copy compare_by_identity status as well.
+	  [ruby-core:24728]
+
 Tue Aug  4 05:43:03 2009  Yukihiro Matsumoto  <matz@r...>
 
 	* thread.c (recursive_push): need to set UNTRUST.  [ruby-dev:38997]
Index: hash.c
===================================================================
--- hash.c	(revision 24381)
+++ hash.c	(revision 24382)
@@ -1060,6 +1060,10 @@
     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)) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]