forked from TrueCloudLab/frostfs-node
[#1671] Use slices.ContainsFunc()
where possible
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
460e5cbccf
commit
ecb6b0793c
5 changed files with 16 additions and 28 deletions
|
@ -3,6 +3,7 @@ package network
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"slices"
|
||||
"sort"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap"
|
||||
|
@ -164,10 +165,8 @@ func WriteToNodeInfo(g AddressGroup, ni *netmap.NodeInfo) {
|
|||
// at least one common address.
|
||||
func (x AddressGroup) Intersects(x2 AddressGroup) bool {
|
||||
for i := range x {
|
||||
for j := range x2 {
|
||||
if x[i].equal(x2[j]) {
|
||||
return true
|
||||
}
|
||||
if slices.ContainsFunc(x2, x[i].equal) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue