mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
1 changed files with 4 additions and 4 deletions
8
array.c
8
array.c
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue