[#1671] Use slices.ContainsFunc() where possible

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2025-03-13 09:34:59 +03:00 committed by Evgenii Stratonikov
parent 460e5cbccf
commit ecb6b0793c
5 changed files with 16 additions and 28 deletions

View file

@ -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
}
}