Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
Co-authored-by: Marco Munizaga <git@marcopolo.io>
  • Loading branch information
marten-seemann and MarcoPolo authored Sep 19, 2022
1 parent f95d416 commit cdd27b7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions p2p/net/swarm/swarm_dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,12 +548,8 @@ func isQUIC(addr ma.Multiaddr) bool {
func maybeRemoveWebTransportAddrs(addrs []ma.Multiaddr) []ma.Multiaddr {
var hasQuic, hasWebTransport bool
for _, addr := range addrs {
if isQUIC(addr) {
hasQuic = true
}
if isWebTransport(addr) {
hasWebTransport = true
}
hasQuic = isQuic(addr)
hasWebTransport = isWebTransport(addr)
}
if !hasWebTransport || !hasQuic {
return addrs
Expand Down

0 comments on commit cdd27b7

Please sign in to comment.