ruby-changes:39779
From: nobu <ko1@a...>
Date: Tue, 15 Sep 2015 13:13:22 +0900 (JST)
Subject: [ruby-changes:39779] nobu:r51860 (trunk): array.c: [DOC] correct Array#sort rdoc [ci skip]
nobu 2015-09-15 13:13:15 +0900 (Tue, 15 Sep 2015) New Revision: 51860 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51860 Log: array.c: [DOC] correct Array#sort rdoc [ci skip] * array.c (rb_ary_sort_bang, rb_ary_sort): [DOC] correct block return values, which may be a negative or positive integer, not ony -1 or +1. Modified files: trunk/ChangeLog trunk/array.c Index: array.c =================================================================== --- array.c (revision 51859) +++ array.c (revision 51860) @@ -2446,8 +2446,8 @@ sort_2(const void *ap, const void *bp, v https://github.com/ruby/ruby/blob/trunk/array.c#L2446 * or using an optional code block. * * The block must implement a comparison between +a+ and +b+ and return - * +-1+ when +b+ follows +a+, +0+ when +a+ and +b+ are equivalent, or ++1+ - * when +a+ follows +b+. + * an integer less than 0 when +b+ follows +a+, +0+ when +a+ and +b+ + * are equivalent, or an integer greater than 0 when +a+ follows +b+. * * See also Enumerable#sort_by. * @@ -2527,8 +2527,8 @@ rb_ary_sort_bang(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L2527 * or using an optional code block. * * The block must implement a comparison between +a+ and +b+ and return - * +-1+ when +b+ follows +a+, +0+ when +a+ and +b+ are equivalent, or ++1+ - * when +a+ follows +b+. + * an integer less than 0 when +b+ follows +a+, +0+ when +a+ and +b+ + * are equivalent, or an integer greater than 0 when +a+ follows +b+. * * * See also Enumerable#sort_by. Index: ChangeLog =================================================================== --- ChangeLog (revision 51859) +++ ChangeLog (revision 51860) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Sep 15 13:13:13 2015 Nobuyoshi Nakada <nobu@r...> + + * array.c (rb_ary_sort_bang, rb_ary_sort): [DOC] correct block + return values, which may be a negative or positive integer, not + ony -1 or +1. + Tue Sep 15 12:49:10 2015 Jason Barnabe <jason.barnabe@g...> * array.c (rb_ary_sort_bang, rb_ary_sort): [DOC] Correct -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/