mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
refactor: using slices.Contains to simplify the code
Signed-off-by: zhoufanjin <shuangcui@live.cn>
This commit is contained in:
parent
6ac0757d82
commit
a97e73ee2c
1 changed files with 1 additions and 7 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue