Use filter deduplication function.

This commit is contained in:
Eugene Bujak 2018-12-06 17:18:34 +03:00
parent e5c1211e17
commit 8fb6f92753

View File

@ -96,20 +96,7 @@ func parseConfig() error {
} }
// Deduplicate filters // Deduplicate filters
{ deduplicateFilters()
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]
}
updateUniqueFilterID(config.Filters) updateUniqueFilterID(config.Filters)