mirror of
https://github.com/Jguer/yay
synced 2024-10-05 23:59:13 +00:00
Simplify stringset function names
Now that stringset has its own module we can use more basic function names while keeping it obvious what it does.
This commit is contained in:
parent
dacd77012c
commit
b60a888981
10
install.go
10
install.go
|
@ -89,8 +89,8 @@ func install(parser *arguments) (err error) {
|
|||
return err
|
||||
}
|
||||
|
||||
remoteNamesCache := stringset.SliceToStringSet(remoteNames)
|
||||
localNamesCache := stringset.SliceToStringSet(localNames)
|
||||
remoteNamesCache := stringset.FromSlice(remoteNames)
|
||||
localNamesCache := stringset.FromSlice(localNames)
|
||||
|
||||
requestTargets := parser.copy().targets
|
||||
|
||||
|
@ -142,7 +142,7 @@ func install(parser *arguments) (err error) {
|
|||
}
|
||||
}
|
||||
|
||||
targets := stringset.SliceToStringSet(parser.targets)
|
||||
targets := stringset.FromSlice(parser.targets)
|
||||
|
||||
dp, err := getDepPool(requestTargets, warnings)
|
||||
if err != nil {
|
||||
|
@ -987,8 +987,8 @@ func buildInstallPkgbuilds(dp *depPool, do *depOrder, srcinfos map[string]*gosrc
|
|||
|
||||
//cache as a stringset. maybe make it return a string set in the first
|
||||
//place
|
||||
remoteNamesCache := stringset.SliceToStringSet(remoteNames)
|
||||
localNamesCache := stringset.SliceToStringSet(localNames)
|
||||
remoteNamesCache := stringset.FromSlice(remoteNames)
|
||||
localNamesCache := stringset.FromSlice(localNames)
|
||||
|
||||
doInstall := func() error {
|
||||
if len(arguments.targets) == 0 {
|
||||
|
|
|
@ -60,8 +60,8 @@ func (set StringSet) Copy() StringSet {
|
|||
return newSet
|
||||
}
|
||||
|
||||
// SliceToStringSet creates a new StringSet from an input slice
|
||||
func SliceToStringSet(in []string) StringSet {
|
||||
// FromSlice creates a new StringSet from an input slice
|
||||
func FromSlice(in []string) StringSet {
|
||||
set := make(StringSet)
|
||||
|
||||
for _, v := range in {
|
||||
|
@ -71,13 +71,13 @@ func SliceToStringSet(in []string) StringSet {
|
|||
return set
|
||||
}
|
||||
|
||||
// MakeStringSet creates a new StringSet from a set of arguments
|
||||
func MakeStringSet(in ...string) StringSet {
|
||||
return SliceToStringSet(in)
|
||||
// Make creates a new StringSet from a set of arguments
|
||||
func Make(in ...string) StringSet {
|
||||
return FromSlice(in)
|
||||
}
|
||||
|
||||
// StringSetEqual compares if two StringSets have the same values
|
||||
func StringSetEqual(a, b StringSet) bool {
|
||||
// Equal compares if two StringSets have the same values
|
||||
func Equal(a, b StringSet) bool {
|
||||
if a == nil && b == nil {
|
||||
return true
|
||||
}
|
||||
|
|
2
print.go
2
print.go
|
@ -392,7 +392,7 @@ func printNumberOfUpdates() error {
|
|||
|
||||
//TODO: Make it less hacky
|
||||
func printUpdateList(parser *arguments) error {
|
||||
targets := stringset.SliceToStringSet(parser.targets)
|
||||
targets := stringset.FromSlice(parser.targets)
|
||||
warnings := &aurWarnings{}
|
||||
old := os.Stdout // keep backup of the real stdout
|
||||
os.Stdout = nil
|
||||
|
|
2
vcs.go
2
vcs.go
|
@ -38,7 +38,7 @@ func createDevelDB() error {
|
|||
}
|
||||
|
||||
bases := getBases(info)
|
||||
toSkip := pkgbuildsToSkip(bases, stringset.SliceToStringSet(remoteNames))
|
||||
toSkip := pkgbuildsToSkip(bases, stringset.FromSlice(remoteNames))
|
||||
_, err = downloadPkgbuilds(bases, toSkip, config.BuildDir)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue