ruby-changes:44493
From: akr <ko1@a...>
Date: Sat, 5 Nov 2016 11:50:19 +0900 (JST)
Subject: [ruby-changes:44493] akr:r56566 (trunk): [DOC] add explanation for Array#sum
akr 2016-11-05 11:50:15 +0900 (Sat, 05 Nov 2016) New Revision: 56566 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56566 Log: [DOC] add explanation for Array#sum Modified files: trunk/array.c Index: array.c =================================================================== --- array.c (revision 56565) +++ array.c (revision 56566) @@ -5717,7 +5717,8 @@ rb_ary_dig(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/array.c#L5717 * ["a", "b", "c"].sum("") #=> "abc" * [[1], [[2]], [3]].sum([]) #=> [1, [2], 3] * - * However, Array#join and Array#flatten is faster than Array#sum. + * However, Array#join and Array#flatten is faster than Array#sum for + * array of strings and array of arrays. * * ["a", "b", "c"].join #=> "abc" * [[1], [[2]], [3]].flatten(1) #=> [1, [2], 3] -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/