mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-16 09:50:45 +00:00
p2p/netutil: fix staticcheck warning SA1021: not use bytes.Equal to compare net.IPs
This commit is contained in:
parent
94d202edc7
commit
36211ef5f1
1 changed files with 1 additions and 1 deletions
|
|
@ -212,7 +212,7 @@ func sameNet(bits uint, ip, other net.IP) bool {
|
||||||
if mask != 0 && nb < len(ip) && ip[nb]&mask != other[nb]&mask {
|
if mask != 0 && nb < len(ip) && ip[nb]&mask != other[nb]&mask {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return nb <= len(ip) && bytes.Equal(ip[:nb], other[:nb])
|
return nb <= len(ip) && ip[:nb].Equal(other[:nb])
|
||||||
}
|
}
|
||||||
|
|
||||||
// DistinctNetSet tracks IPs, ensuring that at most N of them
|
// DistinctNetSet tracks IPs, ensuring that at most N of them
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue