[前][次][番号順一覧][スレッド一覧]

ruby-changes:43525

From: usa <ko1@a...>
Date: Wed, 6 Jul 2016 23:11:26 +0900 (JST)
Subject: [ruby-changes:43525] usa:r55598 (ruby_2_2): merge revision(s) 54168: [Backport #12391]

usa	2016-07-06 23:11:20 +0900 (Wed, 06 Jul 2016)

  New Revision: 55598

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55598

  Log:
    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.

  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/bignum.c
    branches/ruby_2_2/hash.c
    branches/ruby_2_2/include/ruby/intern.h
    branches/ruby_2_2/version.h
Index: ruby_2_2/hash.c
===================================================================
--- ruby_2_2/hash.c	(revision 55597)
+++ ruby_2_2/hash.c	(revision 55598)
@@ -153,6 +153,10 @@ rb_any_hash(VALUE a) https://github.com/ruby/ruby/blob/trunk/ruby_2_2/hash.c#L153
     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));
Index: ruby_2_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 55597)
+++ ruby_2_2/version.h	(revision 55598)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.6"
-#define RUBY_RELEASE_DATE "2016-06-10"
-#define RUBY_PATCHLEVEL 340
+#define RUBY_RELEASE_DATE "2016-07-06"
+#define RUBY_PATCHLEVEL 341
 
 #define RUBY_RELEASE_YEAR 2016
-#define RUBY_RELEASE_MONTH 6
-#define RUBY_RELEASE_DAY 10
+#define RUBY_RELEASE_MONTH 7
+#define RUBY_RELEASE_DAY 6
 
 #include "ruby/version.h"
 
Index: ruby_2_2/bignum.c
===================================================================
--- ruby_2_2/bignum.c	(revision 55597)
+++ ruby_2_2/bignum.c	(revision 55598)
@@ -6780,16 +6780,7 @@ rb_big_aref(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/ruby_2_2/bignum.c#L6780
     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.
- */
-
-static VALUE
+VALUE
 rb_big_hash(VALUE x)
 {
     st_index_t hash;
@@ -7028,7 +7019,6 @@ Init_Bignum(void) https://github.com/ruby/ruby/blob/trunk/ruby_2_2/bignum.c#L7019
     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);
Index: ruby_2_2/include/ruby/intern.h
===================================================================
--- ruby_2_2/include/ruby/intern.h	(revision 55597)
+++ ruby_2_2/include/ruby/intern.h	(revision 55598)
@@ -131,6 +131,7 @@ VALUE rb_big_or(VALUE, VALUE); https://github.com/ruby/ruby/blob/trunk/ruby_2_2/include/ruby/intern.h#L131
 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" */
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 55597)
+++ ruby_2_2/ChangeLog	(revision 55598)
@@ -1,3 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Wed Jul  6 23:02:03 2016  Kenta Murata  <mrkn@m...>
+
+	* 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.
+
 Fri Jun 10 17:48:51 2016  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/optparse.rb (OptionParser::Completion.candidate): get rid of

Property changes on: ruby_2_2
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r54168


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]