From f6b9a0feafe9d3f598867cbb5d1a1dbbb8ba91a6 Mon Sep 17 00:00:00 2001 From: hsbt Date: Tue, 17 Feb 2015 01:47:28 +0000 Subject: * hash.c: Added docs to explain that #include? and #member? do not check member equality * lib/set.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ hash.c | 4 ++++ lib/set.rb | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index 081bb0af31..c2012f93fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Feb 17 10:47:20 2015 Iain Beeston + + * 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 * compile.c (compile_massign): optimization for special case, diff --git a/hash.c b/hash.c index 454ded20fd..3ef6668f5f 100644 --- a/hash.c +++ b/hash.c @@ -1920,6 +1920,10 @@ rb_hash_values(VALUE hash) * h.has_key?("a") #=> true * h.has_key?("z") #=> false * + * Note that include? and member? do not test member + * equality using == as do other Enumerables. + * + * See also Enumerable#include? */ VALUE diff --git a/lib/set.rb b/lib/set.rb index a3f185538f..59d70e82ca 100644 --- a/lib/set.rb +++ b/lib/set.rb @@ -208,6 +208,11 @@ class Set end # Returns true if the set contains the given object. + # + # Note that include? and member? do not test member + # equality using == as do other Enumerables. + # + # See also Enumerable#include? def include?(o) @hash[o] end -- cgit v1.2.3