[#83107] Alias Enumerable#include? to Enumerable#includes? — Alberto Almagro <albertoalmagro@...>

Hello,

9 messages 2017/10/04

[ruby-core:83225] [Ruby trunk Misc#14000] OpenStruct with #frozen_string_literal: true

From: duerst@...
Date: 2017-10-12 04:31:42 UTC
List: ruby-core #83225
Issue #14000 has been updated by duerst (Martin D端rst).


Thanks for looking at where we can use `#frozen_string_literal: true`.

I think it's good to try this, but `#frozen_string_literal: true` should not be used as a cargo cult. So it would be good to know whether your patch leads to some/any speedups or not, or some other improvements.

----------------------------------------
Misc #14000: OpenStruct with #frozen_string_literal: true
https://bugs.ruby-lang.org/issues/14000#change-67174

* Author: esparta (Espartaco Palma)
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
The current implementation of OpenStruct needs minimal changes in order to support frozen strings.
The mutable strings are only on inspect method.

IMO, we have two options:

a) leave the code as it is and just adding .dup where is needed
b) Change to a functional style (map + join) instead of flags + concat.



-- 
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>

In This Thread

Prev Next