зеркало из https://github.com/github/ruby.git
Fix example code in Array#max doc
`[0, 1, 2, 3].max(6)` actually returns `[3, 2, 1, 0]`, but the doc said it returns `[3, 2, 1]`.
This commit is contained in:
Родитель
c7601fb9ed
Коммит
e3e5596782
2
array.c
2
array.c
|
@ -5737,7 +5737,7 @@ ary_max_opt_string(VALUE ary, long i, VALUE vmax)
|
|||
* With an argument \Integer +n+ and no block, returns a new \Array with at most +n+ elements,
|
||||
* in descending order per method <tt><=></tt>:
|
||||
* [0, 1, 2, 3].max(3) # => [3, 2, 1]
|
||||
* [0, 1, 2, 3].max(6) # => [3, 2, 1]
|
||||
* [0, 1, 2, 3].max(6) # => [3, 2, 1, 0]
|
||||
*
|
||||
* When a block is given, the block must return an \Integer.
|
||||
*
|
||||
|
|
Загрузка…
Ссылка в новой задаче