"Addr.IsValid",
"Addr.IsUnspecified",
"Addr.Less",
- "Addr.lessOrEq",
"Addr.Unmap",
"Addr.Zone",
"Addr.v4",
case "amd64", "arm64":
// These don't inline on 32-bit.
wantInlinable = append(wantInlinable,
- "u64CommonPrefixLen",
- "uint128.commonPrefixLen",
"Addr.Next",
"Addr.Prev",
)
// 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.
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() }
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.