up
This commit is contained in:
24
xml.go
24
xml.go
@ -115,19 +115,25 @@ func GetDXCC(dxCall string, Countries Countries) string {
|
||||
}
|
||||
}
|
||||
|
||||
DXCCMatch := DXCCList[0]
|
||||
higherMatch := DXCCList[0].RegExCharacters
|
||||
if len(DXCCList) > 0 {
|
||||
DXCCMatch := DXCCList[0]
|
||||
higherMatch := 0
|
||||
|
||||
if len(DXCCList) > 1 {
|
||||
for i := 0; i < len(DXCCList); i++ {
|
||||
if DXCCList[i].RegExCharacters > higherMatch && !DXCCList[i].Ended {
|
||||
DXCCMatch = DXCCList[i]
|
||||
higherMatch = DXCCList[i].RegExCharacters
|
||||
if len(DXCCList) > 1 {
|
||||
for i := 0; i < len(DXCCList); i++ {
|
||||
if DXCCList[i].RegExCharacters > higherMatch && !DXCCList[i].Ended {
|
||||
DXCCMatch = DXCCList[i]
|
||||
higherMatch = DXCCList[i].RegExCharacters
|
||||
}
|
||||
}
|
||||
} else {
|
||||
DXCCMatch = DXCCList[0]
|
||||
}
|
||||
|
||||
return DXCCMatch.DXCC
|
||||
} else {
|
||||
DXCCMatch = DXCCList[0]
|
||||
Log.Errorf("Could not find %s in country list", dxCall)
|
||||
}
|
||||
|
||||
return DXCCMatch.DXCC
|
||||
return ""
|
||||
}
|
||||
|
Reference in New Issue
Block a user