Merge "Use generics for DepSets"

This commit is contained in:
Colin Cross
2023-06-22 20:57:01 +00:00
committed by Gerrit Code Review
26 changed files with 262 additions and 627 deletions

View File

@@ -2196,23 +2196,3 @@ func IsThirdPartyPath(path string) bool {
}
return false
}
// PathsDepSet is a thin type-safe wrapper around the generic depSet. It always uses
// topological order.
type PathsDepSet struct {
depSet
}
// newPathsDepSet returns an immutable PathsDepSet with the given direct and
// transitive contents.
func newPathsDepSet(direct Paths, transitive []*PathsDepSet) *PathsDepSet {
return &PathsDepSet{*newDepSet(TOPOLOGICAL, direct, transitive)}
}
// ToList returns the PathsDepSet flattened to a list in topological order.
func (d *PathsDepSet) ToList() Paths {
if d == nil {
return nil
}
return d.depSet.ToList().(Paths)
}