diff options
author | Robert Griesemer <gri@golang.org> | 2021-01-22 16:24:05 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2021-01-23 01:08:47 +0000 |
commit | 6923019a716fcc7a99a674df448135d92b603c8a (patch) | |
tree | 85d07a31d3cab4908c1eaf21726c7b9dc53c40af /src/cmd/compile/internal/types2/unify.go | |
parent | e4ef30a66751c39bdd24764763531f1a4c325845 (diff) | |
download | go-6923019a716fcc7a99a674df448135d92b603c8a.tar.gz go-6923019a716fcc7a99a674df448135d92b603c8a.zip |
[dev.typeparams] cmd/compile/internal/types2: factor out sorting of methods
Cleanup and first step towards uniformly changing the sort criteria.
Change-Id: I0a7b6a10b5b646fc83f4897e4915ef4dae24aa66
Reviewed-on: https://go-review.googlesource.com/c/go/+/285993
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/unify.go')
-rw-r--r-- | src/cmd/compile/internal/types2/unify.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/types2/unify.go b/src/cmd/compile/internal/types2/unify.go index 60ccf625b9..ab19c5a38b 100644 --- a/src/cmd/compile/internal/types2/unify.go +++ b/src/cmd/compile/internal/types2/unify.go @@ -6,8 +6,6 @@ package types2 -import "sort" - // The unifier maintains two separate sets of type parameters x and y // which are used to resolve type parameters in the x and y arguments // provided to the unify call. For unidirectional unification, only @@ -386,8 +384,8 @@ func (u *unifier) nify(x, y Type, p *ifacePair) bool { p = p.prev } if debug { - assert(sort.IsSorted(byUniqueMethodName(a))) - assert(sort.IsSorted(byUniqueMethodName(b))) + assertSortedMethods(a) + assertSortedMethods(b) } for i, f := range a { g := b[i] |