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

ruby-changes:39682

From: nobu <ko1@a...>
Date: Sat, 5 Sep 2015 08:29:32 +0900 (JST)
Subject: [ruby-changes:39682] nobu:r51763 (trunk): hash.c: [DOC] orders do not matter [ci skip]

nobu	2015-09-05 08:29:01 +0900 (Sat, 05 Sep 2015)

  New Revision: 51763

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

  Log:
    hash.c: [DOC] orders do not matter [ci skip]
    
    * hash.c (rb_hash_equal, rb_hash_eql): [DOC] the orders of each
      hashes are not compared.  [Bug #11508]

  Modified files:
    trunk/ChangeLog
    trunk/hash.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51762)
+++ ChangeLog	(revision 51763)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Sep  5 08:28:58 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* hash.c (rb_hash_equal, rb_hash_eql): [DOC] the orders of each
+	  hashes are not compared.  [Bug #11508]
+
 Fri Sep  4 23:26:22 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* include/ruby/win32.h: fix macro name for VC runtime version,
Index: hash.c
===================================================================
--- hash.c	(revision 51762)
+++ hash.c	(revision 51763)
@@ -2139,6 +2139,12 @@ hash_equal(VALUE hash1, VALUE hash2, int https://github.com/ruby/ruby/blob/trunk/hash.c#L2139
  *     h2 == h3   #=> true
  *     h3 == h4   #=> false
  *
+ *  The orders of each hashes are not compared.
+ *
+ *     h1 = { "a" => 1, "c" => 2 }
+ *     h2 = { "c" => 2, "a" => 1 }
+ *     h1 == h2   #=> true
+ *
  */
 
 static VALUE
@@ -2153,6 +2159,7 @@ rb_hash_equal(VALUE hash1, VALUE hash2) https://github.com/ruby/ruby/blob/trunk/hash.c#L2159
  *
  *  Returns <code>true</code> if <i>hash</i> and <i>other</i> are
  *  both hashes with the same content.
+ *  The orders of each hashes are not compared.
  */
 
 static VALUE

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

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