Actions
Feature #13000
closedImplement Set#include? with Hash#include?
Feature #13000:
Implement Set#include? with Hash#include?
Description
Why does Set#include? not call Hash#include?? Currently it calls Hash#[].
The protocol of Set already use Hash#include? for ==.
diff --git a/lib/set.rb b/lib/set.rb
index 43c388c..f3dbe2d 100644
--- a/lib/set.rb
+++ b/lib/set.rb
@@ -230,7 +230,7 @@ def flatten!
#
# See also Enumerable#include?
def include?(o)
- @hash[o]
+ @hash.include?(o)
end
alias member? include?
Actions