mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-12 05:37:32 +00:00
net/tsaddr: remove ContainsFunc helpers (they're now in x/exp/slices)
x/exp/slices now has ContainsFunc (golang/go#53983) so we can delete our versions. Change-Id: I5157a403bfc1b30e243bf31c8b611da25e995078 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
4b34c88426
commit
1598cd0361
@@ -207,17 +207,6 @@ func NewContainsIPFunc(addrs []netip.Prefix) func(ip netip.Addr) bool {
|
||||
return func(ip netip.Addr) bool { return m[ip] }
|
||||
}
|
||||
|
||||
// PrefixesContainsFunc reports whether f is true for any IPPrefix in
|
||||
// ipp.
|
||||
func PrefixesContainsFunc(ipp []netip.Prefix, f func(netip.Prefix) bool) bool {
|
||||
for _, v := range ipp {
|
||||
if f(v) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// PrefixesContainsIP reports whether any prefix in ipp contains ip.
|
||||
func PrefixesContainsIP(ipp []netip.Prefix, ip netip.Addr) bool {
|
||||
for _, r := range ipp {
|
||||
@@ -228,16 +217,6 @@ func PrefixesContainsIP(ipp []netip.Prefix, ip netip.Addr) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IPsContainsFunc reports whether f is true for any IP in ips.
|
||||
func IPsContainsFunc(ips []netip.Addr, f func(netip.Addr) bool) bool {
|
||||
for _, v := range ips {
|
||||
if f(v) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// PrefixIs4 reports whether p is an IPv4 prefix.
|
||||
func PrefixIs4(p netip.Prefix) bool { return p.Addr().Is4() }
|
||||
|
||||
|
Reference in New Issue
Block a user