From 8fb6f92753e8bc9c45890a04667944684ce9bb0c Mon Sep 17 00:00:00 2001 From: Eugene Bujak Date: Thu, 6 Dec 2018 17:18:34 +0300 Subject: [PATCH] Use filter deduplication function. --- config.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/config.go b/config.go index 407fcc7a..1f7464b2 100644 --- a/config.go +++ b/config.go @@ -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)