summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-03 20:17:00 +0000
committerstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-03 20:17:00 +0000
commit7c8a060b8521bf071b2340f7f7b2e7b482b693cd (patch)
treeed9258d67eff27aa554ea60aa8602183cc732c91 /array.c
parent4bf1fc3a134a629c7861fd32b7d2753cf01a87c1 (diff)
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
Diffstat (limited to 'array.c')
-rw-r--r--array.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/array.c b/array.c
index 2e57572284..bd13a53430 100644
--- a/array.c
+++ b/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.
*/