From ff1fa78a3601243092f84a69e7332ec2ba9ec05a Mon Sep 17 00:00:00 2001 From: cuiweixie Date: Wed, 12 Jan 2022 19:56:23 +0800 Subject: [PATCH] cmd/compile: pre init shapeMap --- src/cmd/compile/internal/typecheck/subr.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/cmd/compile/internal/typecheck/subr.go b/src/cmd/compile/internal/typecheck/subr.go index 04a4ed392f..4e5f6d8a66 100644 --- a/src/cmd/compile/internal/typecheck/subr.go +++ b/src/cmd/compile/internal/typecheck/subr.go @@ -1447,9 +1447,6 @@ func Shapify(t *types.Type, index int) *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{} @@ -1479,4 +1476,4 @@ func Shapify(t *types.Type, index int) *types.Type { return s } -var shapeMap map[int]map[*types.Type]*types.Type +var shapeMap = map[int]map[*types.Type]*types.Type{}