diff options
author | Robert Griesemer <gri@golang.org> | 2021-08-04 15:18:37 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2021-08-06 20:34:43 +0000 |
commit | 5aac85ad5ebfa9c2ecb01a3292bcf3513d876d7a (patch) | |
tree | c058cc9c80087967f248f1e126664cb8ea08307b /src/cmd/compile/internal/types2/termlist.go | |
parent | 110343e4a2a953a581e34e91e51cef08856b0b0a (diff) | |
download | go-5aac85ad5ebfa9c2ecb01a3292bcf3513d876d7a.tar.gz go-5aac85ad5ebfa9c2ecb01a3292bcf3513d876d7a.zip |
[dev.typeparams] cmd/compile/internal/types2: better names for things (cleanup)
- use the symbol π€ (as in π€niverse) instead of β€ to denote the set
of all types (for better readabilty, β€ is hard to distinguish from
T in some fonts)
- use isAll instead of isTop to test for the set of all types
- use allTermlist instead of topTermlist to denote the termlist
representing all types
Change-Id: Idcb0b3398782b38653338e65173c0dbb935e430a
Reviewed-on: https://go-review.googlesource.com/c/go/+/339891
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/termlist.go')
-rw-r--r-- | src/cmd/compile/internal/types2/termlist.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/cmd/compile/internal/types2/termlist.go b/src/cmd/compile/internal/types2/termlist.go index 07056edd97..378ba6b8f4 100644 --- a/src/cmd/compile/internal/types2/termlist.go +++ b/src/cmd/compile/internal/types2/termlist.go @@ -13,9 +13,9 @@ import "bytes" // normal form. type termlist []*term -// topTermlist represents the set of all types. +// allTermlist represents the set of all types. // It is in normal form. -var topTermlist = termlist{new(term)} +var allTermlist = termlist{new(term)} // String prints the termlist exactly (without normalization). func (xl termlist) String() string { @@ -45,9 +45,9 @@ func (xl termlist) isEmpty() bool { return true } -// isTop reports whether the termlist xl represents the set of all types. -func (xl termlist) isTop() bool { - // If there's a β€ (top) term, the entire list is β€ (top). +// isAll reports whether the termlist xl represents the set of all types. +func (xl termlist) isAll() bool { + // If there's a π€ term, the entire list is π€. // If the termlist is in normal form, this requires at most // one iteration. for _, x := range xl { @@ -74,14 +74,14 @@ func (xl termlist) norm() termlist { continue } if u1, u2 := xi.union(xj); u2 == nil { - // If we encounter a β€ (top) term, the entire - // list is β€ (top). Exit early. + // If we encounter a π€ term, the entire list is π€. + // Exit early. // (Note that this is not just an optimization; - // if we continue, we may end up with a β€ term + // if we continue, we may end up with a π€ term // and other terms and the result would not be // in normal form.) if u1.typ == nil { - return topTermlist + return allTermlist } xi = u1 used[j] = true // xj is now unioned into xi - ignore it in future iterations @@ -92,11 +92,11 @@ func (xl termlist) norm() termlist { return rl } -// If the type set represented by xl is specified by a single (non-β€) term, +// If the type set represented by xl is specified by a single (non-π€) term, // structuralType returns that type. Otherwise it returns nil. func (xl termlist) structuralType() Type { if nl := xl.norm(); len(nl) == 1 { - return nl[0].typ // if nl.isTop() then typ is nil, which is ok + return nl[0].typ // if nl.isAll() then typ is nil, which is ok } return nil } |