Skip to content

Commit 0fa5112

Browse files
authored
Merge pull request #930 from zhoufanjin/master
refactor: using slices.Contains to simplify the code
2 parents 5eeb87a + a97e73e commit 0fa5112

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)