From 3a59b5626da498de0e74a5c02298f04a330f2911 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Tue, 6 Sep 2016 14:26:56 -0700 Subject: [PATCH] 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 --- src/cmd/compile/internal/gc/type.go | 8 -------- 1 file changed, 8 deletions(-) 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 -- 2.48.1