remove unneeded default case in switch

This commit is contained in:
Marten Seemann 2021-03-30 17:01:57 +07:00
parent 9547d0a06f
commit 7c39c5cfde

View File

@ -72,8 +72,6 @@ func IsPublicAddr(a ma.Multiaddr) bool {
switch c.Protocol().Code {
case ma.P_IP6ZONE:
return true
default:
return false
case ma.P_IP4:
ip := net.IP(c.RawValue())
isPublic = !inAddrRange(ip, Private4) && !inAddrRange(ip, Unroutable4)
@ -93,8 +91,6 @@ func IsPrivateAddr(a ma.Multiaddr) bool {
switch c.Protocol().Code {
case ma.P_IP6ZONE:
return true
default:
return false
case ma.P_IP4:
isPrivate = inAddrRange(net.IP(c.RawValue()), Private4)
case ma.P_IP6: