From e90862f0edc08400183c81e08b7a20d5449f6f9b Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 3 Oct 2024 17:02:52 -0400 Subject: [PATCH] [DOC] Correct documentation for Array#max The return value of Array#max is the maximum value per the block, not from the block. --- array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/array.c b/array.c index 562bd3c5d1..c79bae6e8e 100644 --- a/array.c +++ b/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 self.size - 1 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"