]> Cypherpunks repositories - gostls13.git/commit
runtime: use new instead of newobject to create hmap in makemap
authorMartin Möhrmann <moehrmann@google.com>
Sat, 3 Feb 2018 15:29:54 +0000 (16:29 +0100)
committerMartin Möhrmann <moehrmann@google.com>
Thu, 15 Feb 2018 08:57:26 +0000 (08:57 +0000)
commitbf9f1c15035ab9bb695a9a3504e465a1896b4b8c
tree6c683b93d4fe245428ea12a970d29ff876f7efc3
parent530927e08a22badb201d65f44ef9c95b620e5ab6
runtime: use new instead of newobject to create hmap in makemap

The runtime.hmap type is known at compile time.
Using new(hmap) avoids loading the hmap type from the maptype
supplied as an argument to makemap which is only known at runtime.

This change makes makemap consistent with makemap_small
by using new(hmap) instead of newobject in both functions.

Change-Id: Ia47acfda527e8a71d15a1a7a4c2b54fb923515eb
Reviewed-on: https://go-review.googlesource.com/91775
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/hashmap.go