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

ruby-changes:30186

From: glass <ko1@a...>
Date: Mon, 29 Jul 2013 21:58:14 +0900 (JST)
Subject: [ruby-changes:30186] glass:r42238 (trunk): * hash.c (rb_hash_compare_by_id): don't call rb_hash_rehash()

glass	2013-07-29 21:57:40 +0900 (Mon, 29 Jul 2013)

  New Revision: 42238

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

  Log:
    * hash.c (rb_hash_compare_by_id): don't call rb_hash_rehash()
      if self.compare_by_identity? == true.

  Modified files:
    trunk/ChangeLog
    trunk/hash.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42237)
+++ ChangeLog	(revision 42238)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Jul 29 21:53:41 2013  Masaki Matsushita  <glass.saga@g...>
+
+	* hash.c (rb_hash_compare_by_id): don't call rb_hash_rehash()
+	  if self.compare_by_identity? == true.
+
 Mon Jul 29 21:29:48 2013  Masaki Matsushita  <glass.saga@g...>
 
 	* hash.c (rb_hash_assoc): performance improvement by replacing
Index: hash.c
===================================================================
--- hash.c	(revision 42237)
+++ hash.c	(revision 42238)
@@ -2307,6 +2307,7 @@ rb_hash_flatten(int argc, VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/hash.c#L2307
 static VALUE
 rb_hash_compare_by_id(VALUE hash)
 {
+    if (rb_hash_compare_by_id_p(hash)) return hash;
     rb_hash_modify(hash);
     RHASH(hash)->ntbl->type = &identhash;
     rb_hash_rehash(hash);

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

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