Fixed memory leak and made response instant
This commit is contained in:
parent
3ee53b7ad1
commit
c59d47326d
3 changed files with 12 additions and 4 deletions
|
|
@ -23,13 +23,14 @@ func GetOriginalName(name string) string {
|
|||
for i := range langs {
|
||||
go getOriginalNameFromLang(name, langs[i], channel)
|
||||
}
|
||||
var res string
|
||||
for i := 0; i < len(langs); i++ {
|
||||
name := <-channel
|
||||
if name != "" {
|
||||
return name
|
||||
res = name
|
||||
}
|
||||
}
|
||||
return ""
|
||||
return res
|
||||
}
|
||||
|
||||
func getOriginalNameFromLang(name, lang string, channel chan string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue