From be8b7b7d35b2eff9fd4d639b041448afe740bf20 Mon Sep 17 00:00:00 2001
From: YenForYang <YenForYang@users.noreply.github.com>
Date: Tue, 14 Sep 2021 06:54:37 -0500
Subject: [PATCH] Optimize `LoopbackListenHost()` (#615)

---
 listen.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/listen.go b/listen.go
index 29015c10..3840cc14 100644
--- a/listen.go
+++ b/listen.go
@@ -3,7 +3,7 @@ package torrent
 import "strings"
 
 func LoopbackListenHost(network string) string {
-	if strings.Contains(network, "4") {
+	if strings.IndexByte(network, '4') != -1 {
 		return "127.0.0.1"
 	} else {
 		return "::1"
-- 
2.51.0