summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-11 13:50:32 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-11 13:50:32 +0000
commit7dafaea0efc73c94f46447f7949753369ec3e53e (patch)
tree4b961867cca8a312e42235bbf4a0dc4ee0c51101 /hash.c
parent840a4573af4477f699714030d7f5191796d591d7 (diff)
merge revision(s) 54168: [Backport #12391]
* bignum.c (rb_big_hash): make it public function to be available in other source files, and remove documentation comment for Bignum#hash. * bignum.c (Bignum#hash): remove its definition because it is unified with Object#hash. * include/ruby/intern.h (rb_big_hash): add a prototype declaration. * hash.c (any_hash): treat Bignum values directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index b06d651343..6384dc8167 100644
--- a/hash.c
+++ b/hash.c
@@ -153,6 +153,10 @@ any_hash(VALUE a, st_index_t (*other_func)(VALUE))
else if (BUILTIN_TYPE(a) == T_SYMBOL) {
hnum = RSYMBOL(a)->hashval;
}
+ else if (BUILTIN_TYPE(a) == T_BIGNUM) {
+ hval = rb_big_hash(a);
+ hnum = FIX2LONG(hval);
+ }
else if (BUILTIN_TYPE(a) == T_FLOAT) {
flt:
hval = rb_dbl_hash(rb_float_value(a));