From ad97d204f02c1f9ad0433e9178d6ce0f3fdb1f9f Mon Sep 17 00:00:00 2001 From: Robert Findley Date: Thu, 9 Sep 2021 18:41:30 -0400 Subject: [PATCH] go/types: remove some unnecessary loading/expansion of Named types For Identical an u.nify, only type arguments and pointer identity is needed. Change-Id: Id4018d2a53044fa20fd26d28890f28b37b6d6d70 Reviewed-on: https://go-review.googlesource.com/c/go/+/349409 Trust: Robert Findley Run-TryBot: Robert Findley TryBot-Result: Go Bot Reviewed-by: Robert Griesemer --- src/go/types/predicates.go | 3 --- src/go/types/unify.go | 3 --- 2 files changed, 6 deletions(-) diff --git a/src/go/types/predicates.go b/src/go/types/predicates.go index 73d240241e9ceb..9aa565b68a6f59 100644 --- a/src/go/types/predicates.go +++ b/src/go/types/predicates.go @@ -302,9 +302,6 @@ func identical(x, y Type, cmpTags bool, p *ifacePair) bool { // Two named types are identical if their type names originate // in the same type declaration. if y, ok := y.(*Named); ok { - x.expand(nil) - y.expand(nil) - xargs := x.TypeArgs().list() yargs := y.TypeArgs().list() diff --git a/src/go/types/unify.go b/src/go/types/unify.go index ed769aafe87cc4..6d10f71a9010ff 100644 --- a/src/go/types/unify.go +++ b/src/go/types/unify.go @@ -425,9 +425,6 @@ func (u *unifier) nify(x, y Type, p *ifacePair) bool { case *Named: if y, ok := y.(*Named); ok { - x.expand(nil) - y.expand(nil) - xargs := x.targs.list() yargs := y.targs.list()