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

Function Deduplication

pkg/proxy/proxies.go:113–125  ·  view source on GitHub ↗
(src ProxyList)

Source from the content-addressed store, hash-verified

111}
112
113func Deduplication(src ProxyList) ProxyList {
114 result := make(ProxyList, 0, len(src))
115 temp := map[string]struct{}{}
116 for _, item := range src {
117 if item != nil {
118 if _, ok := temp[item.Identifier()]; !ok {
119 temp[item.Identifier()] = struct{}{}
120 result = append(result, item)
121 }
122 }
123 }
124 return result
125}
126
127func (ps ProxyList) Clone() ProxyList {
128 result := make(ProxyList, 0, len(ps))

Callers

nothing calls this directly

Calls 1

IdentifierMethod · 0.65

Tested by

no test coverage detected