浏览代码

p2p/netutil: fix staticcheck warning (#20315)

Felix Lange 6 年之前
父节点
当前提交
5fefe39ba5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      p2p/netutil/net.go

+ 1 - 1
p2p/netutil/net.go

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