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

ruby-changes:44282

From: hsbt <ko1@a...>
Date: Thu, 6 Oct 2016 10:53:24 +0900 (JST)
Subject: [ruby-changes:44282] hsbt:r56355 (trunk): * enum.c: Add reduce/inject alias note.

hsbt	2016-10-06 10:53:17 +0900 (Thu, 06 Oct 2016)

  New Revision: 56355

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

  Log:
    * enum.c: Add reduce/inject alias note.
      [fix GH-1400][ci skip] Patch by @getaaron

  Modified files:
    trunk/ChangeLog
    trunk/enum.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 56354)
+++ ChangeLog	(revision 56355)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Oct  6 10:37:13 2016  SHIBATA Hiroshi  <hsbt@r...>
+
+	* enum.c: Add reduce/inject alias note.
+	  [fix GH-1400][ci skip] Patch by @getaaron
+
 Thu Oct  6 10:30:27 2016  Nobuyoshi Nakada  <nobu@r...>
 
 	* thread.c (update_coverage): check coverage values, and ignore
Index: enum.c
===================================================================
--- enum.c	(revision 56354)
+++ enum.c	(revision 56355)
@@ -705,6 +705,9 @@ ary_inject_op(VALUE ary, VALUE init, VAL https://github.com/ruby/ruby/blob/trunk/enum.c#L705
  *  operation, specified by a block or a symbol that names a
  *  method or operator.
  *
+ *  The <i>inject</i> and <i>reduce</i> methods are aliases. There
+ *  is no performance benefit to either.
+ *
  *  If you specify a block, then for each element in <i>enum</i>
  *  the block is passed an accumulator value (<i>memo</i>) and the element.
  *  If you specify a symbol instead, then each element in the collection

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

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