1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 18:15:42 +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

@ -65,7 +65,7 @@ func (w *worker) mirrorInternal() (*csaf.AggregatorCSAFProvider, error) {
w.summaries = make(map[string][]summary)
// Collecting the categories per label.
w.categories = make(map[string]map[string]bool)
w.categories = map[string]util.Set[string]{}
base, err := url.Parse(w.loc)
if err != nil {
@ -447,7 +447,7 @@ func (w *worker) extractCategories(label string, advisory any) error {
cats := w.categories[label]
if cats == nil {
cats = make(map[string]bool)
cats = util.Set[string]{}
w.categories[label] = cats
}
@ -468,13 +468,13 @@ func (w *worker) extractCategories(label string, advisory any) error {
// Ignore errors here as they result from not matching.
w.expr.Extract(expr, matcher, true, advisory)
} else { // Normal
cats[cat] = true
cats.Add(cat)
}
}
// Add dynamic categories.
for _, cat := range dynamic {
cats[cat] = true
cats.Add(cat)
}
return nil