summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 463c7c8e94..122abb3ea8 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));
}