1
0
mirror of https://github.com/golang/go synced 2024-11-17 14:04:48 -07:00

cmd/compile: pre init shapeMap

Change-Id: I4fea927b9d34e7bf382ddf148a787c1558176f2f
GitHub-Last-Rev: ff1fa78a36
GitHub-Pull-Request: golang/go#50568
Reviewed-on: https://go-review.googlesource.com/c/go/+/377994
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Cherry Mui <cherryyz@google.com>
This commit is contained in:
cuiweixie 2022-01-12 12:01:26 +00:00 committed by Keith Randall
parent caf5cd9da8
commit fa8efc1347

View File

@ -1528,9 +1528,6 @@ func Shapify(t *types.Type, index int, tparam *types.Type) *types.Type {
u = types.Types[types.TUINT8].PtrTo()
}
if shapeMap == nil {
shapeMap = map[int]map[*types.Type]*types.Type{}
}
submap := shapeMap[index]
if submap == nil {
submap = map[*types.Type]*types.Type{}
@ -1561,4 +1558,4 @@ func Shapify(t *types.Type, index int, tparam *types.Type) *types.Type {
return s
}
var shapeMap map[int]map[*types.Type]*types.Type
var shapeMap = map[int]map[*types.Type]*types.Type{}