MCPcopy
hub / github.com/zu1k/proxypool / Deduplication

Method Deduplication

pkg/proxy/proxies.go:47–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45}
46
47func (ps ProxyList) Deduplication() ProxyList {
48 result := make(ProxyList, 0, len(ps))
49 temp := map[string]struct{}{}
50 for _, item := range ps {
51 if item != nil {
52 if _, ok := temp[item.Identifier()]; !ok {
53 temp[item.Identifier()] = struct{}{}
54 result = append(result, item)
55 }
56 }
57 }
58 return result
59}
60
61func (ps ProxyList) Sort() ProxyList {
62 sort.Sort(ps)

Callers 1

CrawlGoFunction · 0.80

Calls 1

IdentifierMethod · 0.65

Tested by

no test coverage detected