Skip to content

Commit a97e73e

Browse files
committed
refactor: using slices.Contains to simplify the code
Signed-off-by: zhoufanjin <shuangcui@live.cn>
1 parent 6ac0757 commit a97e73e

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

session/privacy_flags.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,7 @@ func Parse(flags string) (PrivacyFlags, error) {
162162

163163
// Contains checks if a privacy flag is contained in the set.
164164
func (f PrivacyFlags) Contains(other PrivacyFlag) bool {
165-
for _, flag := range f {
166-
if flag == other {
167-
return true
168-
}
169-
}
170-
171-
return false
165+
return slices.Contains(f, other)
172166
}
173167

174168
// Equal checks if two sets of privacy flags are equal.

0 commit comments

Comments
 (0)