1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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:
Masataka Pocke Kuwabara 2021-05-08 17:04:30 +09:00 committed by Marc-André Lafortune
parent c7601fb9ed
commit e3e5596782
Notes: git 2021-05-08 22:41:30 +09:00

View file

@ -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.
*