diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-08 04:01:06 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-08 04:01:06 +0000 |
commit | 622193d32a5ca27074acd072b655e4037f845dec (patch) | |
tree | f4075af5feb61da0b1685c7a38945e28496481dd /hash.c | |
parent | ad470f1c3833fcd6050881e6d97a1a9cb02e3b20 (diff) |
hash.c: compare symbols by identities
* hash.c (rb_any_hash): Symbols are compared by the identities
always. [ruby-core:68767] [Bug #11035]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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)); } |