Commit 3a59b562 authored by Matthew Dempsky's avatar Matthew Dempsky

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 <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
parent 24d8f3fa
...@@ -560,14 +560,6 @@ func substAny(t *Type, types *[]*Type) *Type { ...@@ -560,14 +560,6 @@ func substAny(t *Type, types *[]*Type) *Type {
params := substAny(t.Params(), types) params := substAny(t.Params(), types)
results := substAny(t.Results(), types) results := substAny(t.Results(), types)
if recvs != t.Recvs() || params != t.Params() || results != t.Results() { 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 = t.Copy()
t.FuncType().Receiver = recvs t.FuncType().Receiver = recvs
t.FuncType().Results = results t.FuncType().Results = results
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment