зеркало из https://github.com/github/ruby.git
Fix call-seq of lazy.filter_map [ci skip]
This commit is contained in:
Родитель
0174285e8c
Коммит
887163beb8
|
@ -2038,12 +2038,11 @@ lazy_filter_map_proc(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
|
|||
|
||||
/*
|
||||
* call-seq:
|
||||
* enum.filter_map { |obj| block } -> an_enumerator
|
||||
* enum.filter_map -> an_enumerator
|
||||
* lazy.filter_map { |obj| block } -> lazy_enumerator
|
||||
*
|
||||
* Returns an enumerator which will return a new array containing the
|
||||
* truthy results (everything except +false+ or +nil+) of running the
|
||||
* +block+ for every element in +enum+.
|
||||
* +block+ for every element in +lazy+.
|
||||
*
|
||||
* (1..).lazy.filter_map { |i| i * 2 if i.even? }.take(5) #=> [4, 8, 12, 16, 20]
|
||||
*
|
||||
|
|
Загрузка…
Ссылка в новой задаче