fix: incorrect checking of strings.Split return value

strings.Split will never return a slice of length 0 if sep is not empty, so any code that checks if the return value is of length 0 is incorrect and useless.
This commit is contained in:
wwqgtxx
2025-06-25 16:17:19 +08:00
parent 166392fe17
commit 5b975275f5
5 changed files with 27 additions and 15 deletions

View File

@@ -1174,8 +1174,6 @@ func parseNameServer(servers []string, respectRules bool, preferH3 bool) ([]dns.
for _, s := range strings.Split(u.Fragment, "&") {
arr := strings.SplitN(s, "=", 2)
switch len(arr) {
case 0:
continue
case 1:
proxyName = arr[0]
case 2: