From: Matthew Dempsky Date: Tue, 6 Sep 2016 21:26:56 +0000 (-0700) Subject: cmd/compile: remove unnecessary FuncType cloning X-Git-Tag: go1.8beta1~1453 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3a59b5626da498de0e74a5c02298f04a330f2911;p=gostls13.git cmd/compile: remove unnecessary FuncType cloning Since FuncTypes are represented as structs rather than linking the parameter lists together, we no longer need to worry about duplicating the parameter lists. Change-Id: I3767aa3cd1cbeddfb80a6eef6b42290dc2ac14ae Reviewed-on: https://go-review.googlesource.com/28574 Run-TryBot: Matthew Dempsky TryBot-Result: Gobot Gobot Reviewed-by: Josh Bleecher Snyder --- diff --git a/src/cmd/compile/internal/gc/type.go b/src/cmd/compile/internal/gc/type.go index ac038f465d..a90864fdab 100644 --- a/src/cmd/compile/internal/gc/type.go +++ b/src/cmd/compile/internal/gc/type.go @@ -560,14 +560,6 @@ func substAny(t *Type, types *[]*Type) *Type { params := substAny(t.Params(), types) results := substAny(t.Results(), types) if recvs != t.Recvs() || params != t.Params() || results != t.Results() { - // Note that this code has to be aware of the - // representation underlying Recvs/Results/Params. - if recvs == t.Recvs() { - recvs = recvs.Copy() - } - if results == t.Results() { - results = results.Copy() - } t = t.Copy() t.FuncType().Receiver = recvs t.FuncType().Results = results