summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-06 15:07:44 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-06 15:07:44 +0000
commitc38982f75f4be560ded527bd4d54398187318ec7 (patch)
tree54e2bcd4b552181bcb86ea7e3d4b886fb4ce4455
parent62b4c459ac89e64861b9bc75f275e31c19085ade (diff)
* bignum.c (Init_Bignum): revert a part of previous commit (r55598),
because the implementation of Object#hash is a little difference from trunk. cf. [Backport #12391] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@55599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--bignum.c10
-rw-r--r--version.h6
3 files changed, 19 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 863c4cb6d7..5dfb43e809 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Jul 7 00:05:00 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * bignum.c (Init_Bignum): revert a part of previous commit (r55598),
+ because the implementation of Object#hash is a little difference from
+ trunk. cf. [Backport #12391]
+
Wed Jul 6 23:02:03 2016 Kenta Murata <mrkn@mrkn.jp>
* bignum.c (rb_big_hash): make it public function to be available in
diff --git a/bignum.c b/bignum.c
index 32c801afd0..fbf2778f9b 100644
--- a/bignum.c
+++ b/bignum.c
@@ -6780,6 +6780,15 @@ rb_big_aref(VALUE x, VALUE y)
return (xds[s1] & bit) ? INT2FIX(1) : INT2FIX(0);
}
+/*
+ * call-seq:
+ * big.hash -> fixnum
+ *
+ * Compute a hash based on the value of _big_.
+ *
+ * See also Object#hash.
+ */
+
VALUE
rb_big_hash(VALUE x)
{
@@ -7019,6 +7028,7 @@ Init_Bignum(void)
rb_define_method(rb_cBignum, "<=", big_le, 1);
rb_define_method(rb_cBignum, "===", rb_big_eq, 1);
rb_define_method(rb_cBignum, "eql?", rb_big_eql, 1);
+ rb_define_method(rb_cBignum, "hash", rb_big_hash, 0);
rb_define_method(rb_cBignum, "to_f", rb_big_to_f, 0);
rb_define_method(rb_cBignum, "abs", rb_big_abs, 0);
rb_define_method(rb_cBignum, "magnitude", rb_big_abs, 0);
diff --git a/version.h b/version.h
index 096a8cc245..63c5e8f22c 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "2.2.6"
-#define RUBY_RELEASE_DATE "2016-07-06"
-#define RUBY_PATCHLEVEL 341
+#define RUBY_RELEASE_DATE "2016-07-07"
+#define RUBY_PATCHLEVEL 342
#define RUBY_RELEASE_YEAR 2016
#define RUBY_RELEASE_MONTH 7
-#define RUBY_RELEASE_DAY 6
+#define RUBY_RELEASE_DAY 7
#include "ruby/version.h"