1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Use Set type (#388)

* Use util.Set type.

* Caught another set usage.
This commit is contained in:
Sascha L. Teichmann 2023-07-04 13:00:01 +02:00 committed by GitHub
parent be3dfcd542
commit 8032d47b50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 40 additions and 40 deletions

View file

@ -12,6 +12,8 @@ import (
"fmt"
"sort"
"strings"
"github.com/csaf-poc/csaf_distribution/v2/util"
)
type (
@ -211,15 +213,15 @@ func (r *redirectsReporter) report(p *processor, domain *Domain) {
// keysNotInValues returns a slice of keys which are not in the values
// of the given map.
func keysNotInValues(m map[string][]string) []string {
values := map[string]bool{}
values := util.Set[string]{}
for _, vs := range m {
for _, v := range vs {
values[v] = true
values.Add(v)
}
}
keys := make([]string, 0, len(m))
for k := range m {
if !values[k] {
if !values.Contains(k) {
keys = append(keys, k)
}
}