]> Cypherpunks repositories - gostls13.git/commitdiff
doc: mention change in append behavior
authorKeith Randall <khr@golang.org>
Thu, 17 Feb 2022 17:37:07 +0000 (09:37 -0800)
committerCarlos Amedee <carlos@golang.org>
Wed, 2 Mar 2022 20:12:33 +0000 (20:12 +0000)
Introduced in CL 347917.

Change-Id: I99b34341f787e779bd45b967110e70a035fa6558
Reviewed-on: https://go-review.googlesource.com/c/go/+/386217
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Martin Möhrmann <martin@golang.org>
Trust: Martin Möhrmann <martin@golang.org>
Run-TryBot: Martin Möhrmann <martin@golang.org>

doc/go1.18.html

index b320579c37408f94b014f738266dd92d5507ad3c..1ca0a5560dfe333e4258adbef039e53d94d56dbc 100644 (file)
@@ -512,6 +512,12 @@ For more information, see <a href="https://go.dev/design/draft-gobuild">https://
   after each value that may be inaccurate.
 </p>
 
+<p><!-- CL 347917 -->
+  The built-in function <code>append</code> now uses a slightly different formula
+  when deciding how much to grow a slice when it must allocate a new underlying array.
+  The new formula is less prone to sudden transitions in allocation behavior.
+</p>
+
 <h2 id="compiler">Compiler</h2>
 
 <p><!-- https://golang.org/issue/40724 -->