From cff03715fff4e3fd9255afc41b6d3fa8c7d72089 Mon Sep 17 00:00:00 2001 From: glass Date: Mon, 29 Jul 2013 12:57:40 +0000 Subject: * hash.c (rb_hash_compare_by_id): don't call rb_hash_rehash() if self.compare_by_identity? == true. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ hash.c | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5ab9d557fc..7a9587df42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Jul 29 21:53:41 2013 Masaki Matsushita + + * 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 * hash.c (rb_hash_assoc): performance improvement by replacing diff --git a/hash.c b/hash.c index 91a28ee569..70b6bd4ac9 100644 --- a/hash.c +++ b/hash.c @@ -2307,6 +2307,7 @@ rb_hash_flatten(int argc, VALUE *argv, VALUE hash) 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); -- cgit v1.2.3