[#83773] [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769 — usa@...
Issue #14108 has been updated by usa (Usaku NAKAMURA).
9 messages
2017/11/15
[#83774] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
usa@garbagecollect.jp wrote:
[#83775] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— "U.NAKAMURA" <usa@...>
2017/11/15
Hi, Eric
[#83779] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[#83781] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— "U.NAKAMURA" <usa@...>
2017/11/15
Hi, Eric,
[#83782] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
IlUuTkFLQU1VUkEiIDx1c2FAZ2FyYmFnZWNvbGxlY3QuanA+IHdyb3RlOgo+IEhpLCBFcmljLAo+
[ruby-core:83911] [Ruby trunk Bug#13000] Implement Set#include? with Hash#include?
From:
headius@...
Date:
2017-11-28 05:45:42 UTC
List:
ruby-core #83911
Issue #13000 has been updated by headius (Charles Nutter). I would prefer the straightforward implementation, but I have some bias. In JRuby, the `[]` method generally is *more* expensive, because it *might* be `String#[]` with a Regex, which needs to be able to set `$~`, so we deoptimize some things when `[]` is being called. What's good for MRI here is bad for JRuby :-) I guess the real question here is whether it would matter if JRuby just used `Hash#include?` in our version of the library. I think there might be some oddities around nil, but that already seems pretty odd in a Set. ---------------------------------------- Bug #13000: Implement Set#include? with Hash#include? https://bugs.ruby-lang.org/issues/13000#change-67960 * Author: headius (Charles Nutter) * Status: Feedback * Priority: Normal * Assignee: knu (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: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>