diff options
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -2450,8 +2450,8 @@ sort_2(const void *ap, const void *bp, void *dummy) * elements returns +0+, the order of the elements is unpredictable. * * a = [ "d", "a", "e", "c", "b" ] - * a.sort! #=> ["a", "b", "c", "d", "e"] - * a.sort! { |x,y| y <=> x } #=> ["e", "d", "c", "b", "a"] + * a.sort! #=> ["a", "b", "c", "d", "e"] + * a.sort! { |a, b| b <=> a } #=> ["e", "d", "c", "b", "a"] * * See also Enumerable#sort_by. */ @@ -2534,8 +2534,8 @@ rb_ary_sort_bang(VALUE ary) * elements returns +0+, the order of the elements is unpredictable. * * a = [ "d", "a", "e", "c", "b" ] - * a.sort #=> ["a", "b", "c", "d", "e"] - * a.sort { |x,y| y <=> x } #=> ["e", "d", "c", "b", "a"] + * a.sort #=> ["a", "b", "c", "d", "e"] + * a.sort { |a, b| b <=> a } #=> ["e", "d", "c", "b", "a"] * * See also Enumerable#sort_by. */ |