]> Cypherpunks repositories - gostls13.git/commitdiff
net/netip: remove unused unexported functions and methods
authorTobias Klauser <tklauser@distanz.ch>
Mon, 7 Nov 2022 16:43:24 +0000 (17:43 +0100)
committerGopher Robot <gobot@golang.org>
Mon, 7 Nov 2022 21:28:44 +0000 (21:28 +0000)
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>
src/net/netip/inlining_test.go
src/net/netip/netip.go
src/net/netip/uint128.go

index 52991bee8c23b30786b1e392a08cc85829b24b85..b521eeebfd8f38cbcf3b2951523f2ba4c725d79d 100644 (file)
@@ -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",
                )
index 2d7c8384993322df68208ac9ac55a6caeaa9c07c..1542af1d1bc8cc066637f90213424ef8979c25cf 100644 (file)
@@ -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() }
index 738939d7de165e034cbd0d13082c26013965b4b0..b1605afbe77eb5e7c7a8eda1091bbdbe6209961f 100644 (file)
@@ -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.