aboutsummaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-18 01:22:38 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-18 01:22:38 +0000
commit1012445af17972089e9e037801d769d3108a9f0f (patch)
tree7d3856ad02f2dbf6bbafe51e1b412ccb22424e92 /hash.c
parentb8f2f4dbcc6cf10a624543e2bd97e2565b1bb182 (diff)
downloadruby-1012445af17972089e9e037801d769d3108a9f0f.tar.gz
* 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/trunk@54168 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 5eebc285af..fa323a1f4e 100644
--- a/hash.c
+++ b/hash.c
@@ -169,6 +169,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));