]> Cypherpunks repositories - gostls13.git/commitdiff
builtin: clarify that make(map[K]V, n) allocates space for n elements
authorIan Lance Taylor <iant@golang.org>
Thu, 8 Sep 2016 16:12:50 +0000 (09:12 -0700)
committerIan Lance Taylor <iant@golang.org>
Sat, 10 Sep 2016 12:57:37 +0000 (12:57 +0000)
Change-Id: Id6265b6093edaa4be2c59e4799351082f7228b5d
Reviewed-on: https://go-review.googlesource.com/28815
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/builtin/builtin.go

index d63ad22c32d46d7fbf68702c7d08113a6830a328..281de0b436883b22d68c207944635c9f44c8a4a3 100644 (file)
@@ -173,8 +173,8 @@ func cap(v Type) int
 //     specify a different capacity; it must be no smaller than the
 //     length, so make([]int, 0, 10) allocates a slice of length 0 and
 //     capacity 10.
-//     Map: An initial allocation is made according to the size but the
-//     resulting map has length 0. The size may be omitted, in which case
+//     Map: An empty map is allocated with enough space to hold the
+//     specified number of elements. The size may be omitted, in which case
 //     a small starting size is allocated.
 //     Channel: The channel's buffer is initialized with the specified
 //     buffer capacity. If zero, or the size is omitted, the channel is