зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
ec0c0e3da2
Коммит
f6b9a0feaf
|
@ -1,3 +1,9 @@
|
|||
Tue Feb 17 10:47:20 2015 Iain Beeston <iain.beeston@gmail.com>
|
||||
|
||||
* 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@ruby-lang.org>
|
||||
|
||||
* compile.c (compile_massign): optimization for special case,
|
||||
|
|
4
hash.c
4
hash.c
|
@ -1920,6 +1920,10 @@ rb_hash_values(VALUE hash)
|
|||
* 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
|
||||
|
|
|
@ -208,6 +208,11 @@ class Set
|
|||
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче