aboutsummaryrefslogtreecommitdiffstats
path: root/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'array.c')
-rw-r--r--array.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/array.c b/array.c
index 18cde10782..2c390f9749 100644
--- a/array.c
+++ b/array.c
@@ -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)
{