summaryrefslogtreecommitdiffstats
path: root/modules/container/set.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/container/set.go')
-rw-r--r--modules/container/set.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/container/set.go b/modules/container/set.go
index 15779983fd..2d654d0aee 100644
--- a/modules/container/set.go
+++ b/modules/container/set.go
@@ -29,6 +29,15 @@ func (s Set[T]) AddMultiple(values ...T) {
}
}
+func (s Set[T]) IsSubset(subset []T) bool {
+ for _, v := range subset {
+ if !s.Contains(v) {
+ return false
+ }
+ }
+ return true
+}
+
// Contains determines whether a set contains the specified element.
// Returns true if the set contains the specified element; otherwise, false.
func (s Set[T]) Contains(value T) bool {