зеркало из https://github.com/github/ruby.git
Document that Enumerable#sum may not respect redefinition of Range#each
It already documented that it may not respect redefinition of Integer#+. Fixes [Bug #13700]
This commit is contained in:
Родитель
71d97a5ef8
Коммит
e496e96547
2
enum.c
2
enum.c
|
@ -4026,7 +4026,7 @@ int_range_sum(VALUE beg, VALUE end, int excl, VALUE init)
|
|||
* "a\nb\nc".each_line.lazy.map(&:chomp).sum("") #=> "abc"
|
||||
*
|
||||
* Enumerable#sum method may not respect method redefinition of "+"
|
||||
* methods such as Integer#+.
|
||||
* methods such as Integer#+, or "each" methods such as Range#each.
|
||||
*/
|
||||
static VALUE
|
||||
enum_sum(int argc, VALUE* argv, VALUE obj)
|
||||
|
|
Загрузка…
Ссылка в новой задаче