mirror of https://github.com/go-redis/redis.git
Remove unused func.
This commit is contained in:
parent
2511a1791d
commit
dbfd75705c
15
cluster.go
15
cluster.go
|
@ -8,20 +8,6 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func removeDuplicates(slice []string) []string {
|
|
||||||
seen := make(map[string]struct{}, len(slice))
|
|
||||||
for i := 0; i < len(slice); {
|
|
||||||
addr := slice[i]
|
|
||||||
if _, ok := seen[addr]; ok {
|
|
||||||
slice = append(slice[:i], slice[i+1:]...)
|
|
||||||
} else {
|
|
||||||
seen[addr] = struct{}{}
|
|
||||||
i++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return slice
|
|
||||||
}
|
|
||||||
|
|
||||||
type ClusterClient struct {
|
type ClusterClient struct {
|
||||||
commandable
|
commandable
|
||||||
|
|
||||||
|
@ -285,7 +271,6 @@ func (opt *ClusterOptions) getMaxRedirects() int {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *ClusterOptions) getAddrs() []string {
|
func (opt *ClusterOptions) getAddrs() []string {
|
||||||
opt.Addrs = removeDuplicates(opt.Addrs)
|
|
||||||
return opt.Addrs
|
return opt.Addrs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue