diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-06 14:11:20 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-06 14:11:20 +0000 |
commit | 62b4c459ac89e64861b9bc75f275e31c19085ade (patch) | |
tree | 4baefb9128d4e258f347ae55c2a2913ffcb87662 /hash.c | |
parent | 3c7a96bfa2d21336d985ceda544c4ccabafebed5 (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_2@55598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -153,6 +153,10 @@ rb_any_hash(VALUE a) else if (BUILTIN_TYPE(a) == T_SYMBOL) { return 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)); |