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

ruby-changes:37535

From: hsbt <ko1@a...>
Date: Tue, 17 Feb 2015 10:47:39 +0900 (JST)
Subject: [ruby-changes:37535] hsbt:r49616 (trunk): * hash.c: Added docs to explain that #include? and #member? do not

hsbt	2015-02-17 10:47:28 +0900 (Tue, 17 Feb 2015)

  New Revision: 49616

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

  Log:
    * hash.c: Added docs to explain that #include? and #member? do not
      check member equality
    * lib/set.rb: ditto

  Modified files:
    trunk/ChangeLog
    trunk/hash.c
    trunk/lib/set.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 49615)
+++ ChangeLog	(revision 49616)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Feb 17 10:47:20 2015  Iain Beeston  <iain.beeston@g...>
+
+	* hash.c: Added docs to explain that #include? and #member? do not
+	  check member equality
+	* lib/set.rb: ditto
+
 Mon Feb 16 20:58:49 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* compile.c (compile_massign): optimization for special case,
Index: lib/set.rb
===================================================================
--- lib/set.rb	(revision 49615)
+++ lib/set.rb	(revision 49616)
@@ -208,6 +208,11 @@ class Set https://github.com/ruby/ruby/blob/trunk/lib/set.rb#L208
   end
 
   # Returns true if the set contains the given object.
+  #
+  # Note that <code>include?</code> and <code>member?</code> do not test member
+  # equality using <code>==</code> as do other Enumerables.
+  #
+  # See also Enumerable#include?
   def include?(o)
     @hash[o]
   end
Index: hash.c
===================================================================
--- hash.c	(revision 49615)
+++ hash.c	(revision 49616)
@@ -1920,6 +1920,10 @@ rb_hash_values(VALUE hash) https://github.com/ruby/ruby/blob/trunk/hash.c#L1920
  *     h.has_key?("a")   #=> true
  *     h.has_key?("z")   #=> false
  *
+ *  Note that <code>include?</code> and <code>member?</code> do not test member
+ *  equality using <code>==</code> as do other Enumerables.
+ *
+ *  See also Enumerable#include?
  */
 
 VALUE

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

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