summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--bignum.c2
-rw-r--r--hash.c4
-rw-r--r--include/ruby/intern.h1
-rw-r--r--version.h6
5 files changed, 21 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 9c3ffb1b41..b66f50aef5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Mon Jul 11 22:35:00 2016 Kenta Murata <mrkn@mrkn.jp>
+
+ * 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.
+
Sat Jul 2 04:00:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (tr_trans): consider terminator length and fix heap
diff --git a/bignum.c b/bignum.c
index e71c414d27..38380f6c4e 100644
--- a/bignum.c
+++ b/bignum.c
@@ -6804,7 +6804,7 @@ rb_big_aref(VALUE x, VALUE y)
* See also Object#hash.
*/
-static VALUE
+VALUE
rb_big_hash(VALUE x)
{
st_index_t hash;
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));
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index 99b850c895..aec2d528ca 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -131,6 +131,7 @@ VALUE rb_big_or(VALUE, VALUE);
VALUE rb_big_xor(VALUE, VALUE);
VALUE rb_big_lshift(VALUE, VALUE);
VALUE rb_big_rshift(VALUE, VALUE);
+VALUE rb_big_hash(VALUE);
/* For rb_integer_pack and rb_integer_unpack: */
/* "MS" in MSWORD and MSBYTE means "most significant" */
diff --git a/version.h b/version.h
index b6e35a02df..80eb70ceb1 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "2.3.2"
-#define RUBY_RELEASE_DATE "2016-07-02"
-#define RUBY_PATCHLEVEL 137
+#define RUBY_RELEASE_DATE "2016-07-11"
+#define RUBY_PATCHLEVEL 138
#define RUBY_RELEASE_YEAR 2016
#define RUBY_RELEASE_MONTH 7
-#define RUBY_RELEASE_DAY 2
+#define RUBY_RELEASE_DAY 11
#include "ruby/version.h"