From: shyouhei@... Date: 2016-12-21T06:08:56+00:00 Subject: [ruby-core:78758] [Ruby trunk Bug#13000][Assigned] Implement Set#include? with Hash#include? Issue #13000 has been updated by Shyouhei Urabe. Status changed from Open to Assigned Assignee set to Akinori MUSHA ---------------------------------------- Bug #13000: Implement Set#include? with Hash#include? https://bugs.ruby-lang.org/issues/13000#change-62156 * Author: Charles Nutter * Status: Assigned * Priority: Normal * Assignee: Akinori MUSHA * Target version: * ruby -v: * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- Why does `Set#include?` not call `Hash#include?`? Currently it calls `Hash#[]`. The protocol of Set already use `Hash#include?` for `==`. ```diff 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? ``` -- https://bugs.ruby-lang.org/ Unsubscribe: