[#92070] [Ruby trunk Feature#15667] Introduce malloc_trim(0) in full gc cycles — sam.saffron@...
Issue #15667 has been updated by sam.saffron (Sam Saffron).
3 messages
2019/04/01
[ruby-core:92406] [Ruby trunk Feature#15323] [PATCH] Proposal: Add Enumerable#filter_map
From:
me@...
Date:
2019-04-25 09:54:16 UTC
List:
ruby-core #92406
Issue #15323 has been updated by alfonsojimenez (Alfonso Jim駭ez).
I've updated the patch file increasing the ruby version in *spec/ruby/core/enumerable/filter_map_spec.rb*
`Enumerable#filter_map` was already accepted in the last developers meeting: https://docs.google.com/document/u/2/d/e/2PACX-1vTUCmj7aUdnMAdunG0AZo0AdWK-9jvfXcB7DWYmzGtmPc0IuIPGn7eLARoR5tBd6XUUB08W-hH74k-T/pub
----------------------------------------
Feature #15323: [PATCH] Proposal: Add Enumerable#filter_map
https://bugs.ruby-lang.org/issues/15323#change-77764
* Author: alfonsojimenez (Alfonso Jim駭ez)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
This is a proposal for a combined `filter` + `map` method (https://bugs.ruby-lang.org/issues/5663).
This method both filters and maps the elements of an enumerable in just one iteration:
~~~ ruby
(1..10).filter_map { |i| i * 2 if i.even? } #=> [4, 8, 12, 16, 20]
~~~
GitHub PR: https://github.com/ruby/ruby/pull/2017
---Files--------------------------------
0001-Adding-Enumerable-filter_map.patch (4.61 KB)
--
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>