[DOC] Correct documentation for Array#max
The return value of Array#max is the maximum value per the block, not from the block.
This commit is contained in:
parent
3ece042c38
commit
e90862f0ed
2
array.c
2
array.c
@ -5948,7 +5948,7 @@ ary_max_opt_string(VALUE ary, long i, VALUE vmax)
|
||||
* With a block given, the block must return a numeric.
|
||||
*
|
||||
* With a block and no argument, calls the block <tt>self.size - 1</tt> times to compare elements;
|
||||
* returns the element having the maximum return value from the block:
|
||||
* returns the element having the maximum return value per the block:
|
||||
*
|
||||
* ['0', '', '000', '00'].max {|a, b| a.size <=> b.size }
|
||||
* # => "000"
|
||||
|
Loading…
x
Reference in New Issue
Block a user