[前][次][番号順一覧][スレッド一覧]

ruby-changes:47223

From: kazu <ko1@a...>
Date: Sat, 15 Jul 2017 13:35:23 +0900 (JST)
Subject: [ruby-changes:47223] kazu:r59338 (trunk): Fix warning: shadowing outer local variable - a

kazu	2017-07-15 13:35:18 +0900 (Sat, 15 Jul 2017)

  New Revision: 59338

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59338

  Log:
    Fix warning: shadowing outer local variable - a
    
    [ci skip][Fix GH-1628]

  Modified files:
    trunk/array.c
Index: array.c
===================================================================
--- array.c	(revision 59337)
+++ array.c	(revision 59338)
@@ -2455,9 +2455,9 @@ sort_2(const void *ap, const void *bp, v https://github.com/ruby/ruby/blob/trunk/array.c#L2455
  *  The result is not guaranteed to be stable.  When the comparison of two
  *  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! { |a, b| b <=> a }  #=> ["e", "d", "c", "b", "a"]
+ *     ary = [ "d", "a", "e", "c", "b" ]
+ *     ary.sort!                     #=> ["a", "b", "c", "d", "e"]
+ *     ary.sort! { |a, b| b <=> a }  #=> ["e", "d", "c", "b", "a"]
  *
  *  See also Enumerable#sort_by.
  */
@@ -2539,9 +2539,9 @@ rb_ary_sort_bang(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L2539
  *  The result is not guaranteed to be stable.  When the comparison of two
  *  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 { |a, b| b <=> a }  #=> ["e", "d", "c", "b", "a"]
+ *     ary = [ "d", "a", "e", "c", "b" ]
+ *     ary.sort                     #=> ["a", "b", "c", "d", "e"]
+ *     ary.sort { |a, b| b <=> a }  #=> ["e", "d", "c", "b", "a"]
  *
  *  See also Enumerable#sort_by.
  */

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]