1
0
mirror of https://github.com/nitezs/sub2clash.git synced 2024-12-23 14:14:42 -05:00

fix: 修复重名节点没有正确重命名的问题

This commit is contained in:
Nite07 2024-03-09 15:58:16 +08:00
parent 70f5c63fe2
commit d8a81e44b6

View File

@ -173,9 +173,11 @@ func BuildSub(clashType model.ClashType, query validator.SubValidator, template
names := make(map[string]int)
for i := range proxyList {
if _, exist := names[proxyList[i].Name]; exist {
names[proxyList[i].Name] = names[proxyList[i].Name] + 1
proxyList[i].Name = proxyList[i].Name + " " + strconv.Itoa(names[proxyList[i].Name])
} else {
names[proxyList[i].Name] = 0
}
names[proxyList[i].Name] = names[proxyList[i].Name] + 1
}
// trim
for i := range proxyList {