refactor: using slices.Contains to simplify the code

Signed-off-by: zhoufanjin <shuangcui@live.cn>
This commit is contained in:
zhoufanjin 2025-01-09 15:38:45 +08:00
parent 6ac0757d82
commit a97e73ee2c

View file

@ -162,13 +162,7 @@ func Parse(flags string) (PrivacyFlags, error) {
// Contains checks if a privacy flag is contained in the set.
func (f PrivacyFlags) Contains(other PrivacyFlag) bool {
for _, flag := range f {
if flag == other {
return true
}
}
return false
return slices.Contains(f, other)
}
// Equal checks if two sets of privacy flags are equal.