From 92e97984c60d4f3f43479537e1510039fec9fa28 Mon Sep 17 00:00:00 2001 From: nagachika Date: Sat, 23 May 2015 17:02:11 +0000 Subject: merge revision(s) 50182,50183: [Backport #11035] * hash.c (rb_any_hash): Symbols are compared by the identities always. [ruby-core:68767] [Bug #11035] * test/ruby/test_symbol.rb: fix syntax error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@50620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- hash.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hash.c') diff --git a/hash.c b/hash.c index 3ef0ed458f..fb4c5a5d1b 100644 --- a/hash.c +++ b/hash.c @@ -149,6 +149,9 @@ rb_any_hash(VALUE a) else if (BUILTIN_TYPE(a) == T_STRING) { hnum = rb_str_hash(a); } + else if (BUILTIN_TYPE(a) == T_SYMBOL) { + hnum = rb_objid_hash((st_index_t)a); + } else if (BUILTIN_TYPE(a) == T_FLOAT) { return rb_dbl_hash(rb_float_value(a)); } -- cgit v1.2.3