mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Utilize new set type more.
This commit is contained in:
parent
71a3c3a13b
commit
c6d0e9a9e2
2 changed files with 21 additions and 20 deletions
10
util/set.go
10
util/set.go
|
|
@ -41,3 +41,13 @@ func (s Set[K]) Difference(t Set[K]) Set[K] {
|
|||
}
|
||||
return d
|
||||
}
|
||||
|
||||
// ContainsAll returns true if all keys of a given set are in this set.
|
||||
func (s Set[K]) ContainsAll(t Set[K]) bool {
|
||||
for k := range t {
|
||||
if !s.Contains(k) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue