aboutsummaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2022-11-07 17:43:24 +0100
committerGopher Robot <gobot@golang.org>2022-11-07 21:28:44 +0000
commitb417f62b00276a2ccca3fa7e490f3673a1df8a4c (patch)
tree69a4142b1ab0592faa1f2b53ed1e6944c7600aba /src/net
parent6bead8f77afd2f7317eb011ca019b61ac3d90c17 (diff)
downloadgo-b417f62b00276a2ccca3fa7e490f3673a1df8a4c.tar.xz
net/netip: remove unused unexported functions and methods
Change-Id: I71774ad0197ce654dc56c2fa2fa12f1e6696382e Reviewed-on: https://go-review.googlesource.com/c/go/+/448395 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/net')
-rw-r--r--src/net/netip/inlining_test.go3
-rw-r--r--src/net/netip/netip.go5
-rw-r--r--src/net/netip/uint128.go11
3 files changed, 0 insertions, 19 deletions
diff --git a/src/net/netip/inlining_test.go b/src/net/netip/inlining_test.go
index 52991bee8c..b521eeebfd 100644
--- a/src/net/netip/inlining_test.go
+++ b/src/net/netip/inlining_test.go
@@ -42,7 +42,6 @@ func TestInlining(t *testing.T) {
"Addr.IsValid",
"Addr.IsUnspecified",
"Addr.Less",
- "Addr.lessOrEq",
"Addr.Unmap",
"Addr.Zone",
"Addr.v4",
@@ -81,8 +80,6 @@ func TestInlining(t *testing.T) {
case "amd64", "arm64":
// These don't inline on 32-bit.
wantInlinable = append(wantInlinable,
- "u64CommonPrefixLen",
- "uint128.commonPrefixLen",
"Addr.Next",
"Addr.Prev",
)
diff --git a/src/net/netip/netip.go b/src/net/netip/netip.go
index 2d7c838499..1542af1d1b 100644
--- a/src/net/netip/netip.go
+++ b/src/net/netip/netip.go
@@ -459,8 +459,6 @@ func (ip Addr) Compare(ip2 Addr) int {
// IPv6 addresses with zones sort just after the same address without a zone.
func (ip Addr) Less(ip2 Addr) bool { return ip.Compare(ip2) == -1 }
-func (ip Addr) lessOrEq(ip2 Addr) bool { return ip.Compare(ip2) <= 0 }
-
// Is4 reports whether ip is an IPv4 address.
//
// It returns false for IPv4-mapped IPv6 addresses. See Addr.Unmap.
@@ -1118,9 +1116,6 @@ func MustParseAddrPort(s string) AddrPort {
return ip
}
-// isZero reports whether p is the zero AddrPort.
-func (p AddrPort) isZero() bool { return p == AddrPort{} }
-
// IsValid reports whether p.Addr() is valid.
// All ports are valid, including zero.
func (p AddrPort) IsValid() bool { return p.ip.IsValid() }
diff --git a/src/net/netip/uint128.go b/src/net/netip/uint128.go
index 738939d7de..b1605afbe7 100644
--- a/src/net/netip/uint128.go
+++ b/src/net/netip/uint128.go
@@ -60,17 +60,6 @@ func (u uint128) addOne() uint128 {
return uint128{u.hi + carry, lo}
}
-func u64CommonPrefixLen(a, b uint64) uint8 {
- return uint8(bits.LeadingZeros64(a ^ b))
-}
-
-func (u uint128) commonPrefixLen(v uint128) (n uint8) {
- if n = u64CommonPrefixLen(u.hi, v.hi); n == 64 {
- n += u64CommonPrefixLen(u.lo, v.lo)
- }
- return
-}
-
// halves returns the two uint64 halves of the uint128.
//
// Logically, think of it as returning two uint64s.