]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: pre init shapeMap
authorcuiweixie <cuiweixie@gmail.com>
Wed, 12 Jan 2022 12:01:26 +0000 (12:01 +0000)
committerKeith Randall <khr@golang.org>
Sat, 19 Mar 2022 23:49:55 +0000 (23:49 +0000)
Change-Id: I4fea927b9d34e7bf382ddf148a787c1558176f2f
GitHub-Last-Rev: ff1fa78a3601243092f84a69e7332ec2ba9ec05a
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>

src/cmd/compile/internal/typecheck/subr.go

index fdc6ba5929437201c13e163e15a45eac38fa3e7b..e19e439c8ad8511f854496e7d6233ad112d3039e 100644 (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{}