@@ -3556,28 +3556,24 @@ sort_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, dummy))
3556
3556
3557
3557
/*
3558
3558
* call-seq:
3559
- * array. sort_by! {|element| ... } -> self
3560
- * array. sort_by! -> new_enumerator
3559
+ * sort_by! {|element| ... } -> self
3560
+ * sort_by! -> new_enumerator
3561
3561
*
3562
- * Sorts the elements of +self+ in place,
3563
- * using an ordering determined by the block; returns self.
3562
+ * With a block given, sorts the elements of +self+ in place;
3563
+ * returns self.
3564
3564
*
3565
3565
* Calls the block with each successive element;
3566
- * sorts elements based on the values returned from the block.
3567
- *
3568
- * For duplicates returned by the block, the ordering is indeterminate, and may be unstable.
3569
- *
3570
- * This example sorts strings based on their sizes:
3566
+ * sorts elements based on the values returned from the block:
3571
3567
*
3572
3568
* a = ['aaaa', 'bbb', 'cc', 'd']
3573
3569
* a.sort_by! {|element| element.size }
3574
3570
* a # => ["d", "cc", "bbb", "aaaa"]
3575
3571
*
3576
- * Returns a new Enumerator if no block given:
3572
+ * For duplicate values returned by the block, the ordering is indeterminate, and may be unstable.
3577
3573
*
3578
- * a = ['aaaa', 'bbb', 'cc', 'd']
3579
- * a.sort_by! # => #<Enumerator: ["aaaa", "bbb", "cc", "d"]:sort_by!>
3574
+ * With no block given, returns a new Enumerator.
3580
3575
*
3576
+ * Related: see {Methods for Assigning}[rdoc-ref:Array@Methods+for+Assigning].
3581
3577
*/
3582
3578
3583
3579
static VALUE
0 commit comments