From ca993d679729dbf312530d15f0489a45d1b61eaa Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 8 Sep 2016 09:12:50 -0700 Subject: [PATCH] builtin: clarify that make(map[K]V, n) allocates space for n elements Change-Id: Id6265b6093edaa4be2c59e4799351082f7228b5d Reviewed-on: https://go-review.googlesource.com/28815 Reviewed-by: Brad Fitzpatrick Reviewed-by: Rob Pike --- src/builtin/builtin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/builtin/builtin.go b/src/builtin/builtin.go index d63ad22c32..281de0b436 100644 --- a/src/builtin/builtin.go +++ b/src/builtin/builtin.go @@ -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 -- 2.48.1