aboutsummaryrefslogtreecommitdiff
path: root/test/makemap.go
AgeCommit message (Collapse)Author
2020-04-19test: remove duplicate code from makechan/makemapalex-semenyuk
Change-Id: Ib9bcfaa12d42bf9d2045aef035080b1a990a8b98 GitHub-Last-Rev: bee77a8970b8c4483a8106598721472623cf8ec2 GitHub-Pull-Request: golang/go#38047 Reviewed-on: https://go-review.googlesource.com/c/go/+/225219 Reviewed-by: Martin Möhrmann <moehrmann@google.com> Run-TryBot: Martin Möhrmann <moehrmann@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-03-14test: check that size argument errors are emitted at call siteTobias Klauser
Add tests for the "negative size argument in make.*" and "size argument too large in make.*" error messages to appear at call sites in case the size is a const defined on another line. As suggested by Matthew in a comment on CL 69910. Change-Id: I5c33d4bec4e3d20bb21fe8019df27999997ddff3 Reviewed-on: https://go-review.googlesource.com/100395 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-08-22cmd/compile: generate makemap calls with int argumentsMartin Möhrmann
Where possible generate calls to runtime makemap with int hint argument during compile time instead of makemap with int64 hint argument. This eliminates converting the hint argument for calls to makemap with int64 hint argument for platforms where int64 values do not fit into an argument of type int. A similar optimization for makeslice was introduced in CL golang.org/cl/27851. 386: name old time/op new time/op delta NewEmptyMap 53.5ns ± 5% 41.9ns ± 5% -21.56% (p=0.000 n=10+10) NewSmallMap 182ns ± 1% 165ns ± 1% -8.92% (p=0.000 n=10+10) Change-Id: Ibd2b4c57b36f171b173bf7a0602b3a59771e6e44 Reviewed-on: https://go-review.googlesource.com/55142 Reviewed-by: Keith Randall <khr@golang.org>