array.c (rb_ary_plus): in documentation, added note about

inefficiency of repeated += operations. [ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
duerst 2014-12-02 06:30:05 +00:00
Родитель 062f0eddc7
Коммит 24f5f816ff
2 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Tue Dec 2 15:30:30 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
* array.c (rb_ary_plus): in documentation, added note about
inefficiency of repeated += operations.
Tue Dec 2 07:20:21 2014 Eric Wong <e@80x24.org>
* iseq.c (iseq_data_to_ary): keep hidden variables

Просмотреть файл

@ -3525,9 +3525,17 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
* c #=> [ "a", "b", "c", "d", "e", "f" ]
* a #=> [ "a", "b", "c" ]
*
* Note that
* x += y
* is the same as
* x = x + y
* This means that it produces a new array. As a consequence,
* repeated use of += on arrays can be quite inefficient.
*
* See also Array#concat.
*/
VALUE
rb_ary_plus(VALUE x, VALUE y)
{