()
| 45 | } |
| 46 | |
| 47 | func (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 | |
| 61 | func (ps ProxyList) Sort() ProxyList { |
| 62 | sort.Sort(ps) |