Use filter deduplication function.

This commit is contained in:
Eugene Bujak 2018-12-06 17:18:34 +03:00
parent e5c1211e17
commit 8fb6f92753
1 changed files with 1 additions and 14 deletions

View File

@ -96,20 +96,7 @@ func parseConfig() error {
}
// Deduplicate filters
{
i := 0 // output index, used for deletion later
urls := map[string]bool{}
for _, filter := range config.Filters {
if _, ok := urls[filter.URL]; !ok {
// we didn't see it before, keep it
urls[filter.URL] = true // remember the URL
config.Filters[i] = filter
i++
}
}
// all entries we want to keep are at front, delete the rest
config.Filters = config.Filters[:i]
}
deduplicateFilters()
updateUniqueFilterID(config.Filters)