fix: address code review findings (consolidate slice helpers, correct bootleg comment)
This commit is contained in:
@@ -94,10 +94,9 @@ func FilterReleaseGroups(groups []ReleaseGroup, opts FilterOptions) []ReleaseGro
|
||||
return filtered
|
||||
}
|
||||
|
||||
// hasSecondaryType reports whether any of the release group's secondary types
|
||||
// matches one of the provided values.
|
||||
func hasSecondaryType(rg ReleaseGroup, wanted ...string) bool {
|
||||
for _, s := range rg.SecondaryTypes {
|
||||
// hasSliceType reports whether the slice contains any of the wanted values.
|
||||
func hasSliceType(types []string, wanted ...string) bool {
|
||||
for _, s := range types {
|
||||
for _, w := range wanted {
|
||||
if s == w {
|
||||
return true
|
||||
@@ -107,6 +106,12 @@ func hasSecondaryType(rg ReleaseGroup, wanted ...string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// hasSecondaryType reports whether any of the release group's secondary types
|
||||
// matches one of the provided values.
|
||||
func hasSecondaryType(rg ReleaseGroup, wanted ...string) bool {
|
||||
return hasSliceType(rg.SecondaryTypes, wanted...)
|
||||
}
|
||||
|
||||
// IsTypeIncluded returns true if the given primary type is in the base
|
||||
// included set (Album/Single/EP).
|
||||
func IsTypeIncluded(releaseType string) bool {
|
||||
|
||||
Reference in New Issue
Block a user