array.c: docs for Array#{sort,sort!}
* array.c: [DOC] make example in the docs for Array#{sort,sort!} match the call-seq and description by using the same block vars. Based on a patch by Roque Pinel (repinel). [Fix GH-1628] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4bf1fc3a13
commit
7c8a060b85
4
array.c
4
array.c
@ -2451,7 +2451,7 @@ sort_2(const void *ap, const void *bp, void *dummy)
|
||||
*
|
||||
* 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| b <=> a } #=> ["e", "d", "c", "b", "a"]
|
||||
*
|
||||
* See also Enumerable#sort_by.
|
||||
*/
|
||||
@ -2535,7 +2535,7 @@ rb_ary_sort_bang(VALUE ary)
|
||||
*
|
||||
* 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| b <=> a } #=> ["e", "d", "c", "b", "a"]
|
||||
*
|
||||
* See also Enumerable#sort_by.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user