mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-18 14:54:24 +01:00
Remove duplicates in the relays list before fetching last notes
This commit is contained in:
12
utils.go
12
utils.go
@@ -324,3 +324,15 @@ func mdToHTML(md string) string {
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
func unique(strSlice []string) []string {
|
||||
keys := make(map[string]bool)
|
||||
list := []string{}
|
||||
for _, entry := range strSlice {
|
||||
if _, ok := keys[entry]; !ok {
|
||||
keys[entry] = true
|
||||
list = append(list, entry)
|
||||
}
|
||||
}
|
||||
return list
|
||||
}
|
||||
Reference in New Issue
Block a user