Optimize `LoopbackListenHost()` (#615)
This commit is contained in:
parent
f6b024e157
commit
be8b7b7d35
|
@ -3,7 +3,7 @@ package torrent
|
||||||
import "strings"
|
import "strings"
|
||||||
|
|
||||||
func LoopbackListenHost(network string) string {
|
func LoopbackListenHost(network string) string {
|
||||||
if strings.Contains(network, "4") {
|
if strings.IndexByte(network, '4') != -1 {
|
||||||
return "127.0.0.1"
|
return "127.0.0.1"
|
||||||
} else {
|
} else {
|
||||||
return "::1"
|
return "::1"
|
||||||
|
|
Loading…
Reference in New Issue