mirror of
https://github.com/nitezs/sub2clash.git
synced 2024-12-24 10:54:43 -05:00
fix
This commit is contained in:
parent
429788a19f
commit
c1e9099156
@ -95,12 +95,15 @@ func BuildSub(clashType model.ClashType, query validator.SubValidator, template
|
|||||||
}
|
}
|
||||||
// 去重
|
// 去重
|
||||||
proxies := make(map[string]*model.Proxy)
|
proxies := make(map[string]*model.Proxy)
|
||||||
|
newProxies := make([]model.Proxy, 0, len(proxyList))
|
||||||
for i := range proxyList {
|
for i := range proxyList {
|
||||||
key := proxyList[i].Server + ":" + strconv.Itoa(proxyList[i].Port) + ":" + proxyList[i].Type
|
key := proxyList[i].Server + ":" + strconv.Itoa(proxyList[i].Port) + ":" + proxyList[i].Type
|
||||||
if _, exist := proxies[key]; exist {
|
if _, exist := proxies[key]; !exist {
|
||||||
proxyList = append(proxyList[:i], proxyList[i+1:]...)
|
proxies[key] = &proxyList[i]
|
||||||
|
newProxies = append(newProxies, proxyList[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
proxyList = newProxies
|
||||||
// 重名检测
|
// 重名检测
|
||||||
names := make(map[string]bool)
|
names := make(map[string]bool)
|
||||||
for i := range proxyList {
|
for i := range proxyList {
|
||||||
|
Loading…
Reference in New Issue
Block a user