mirror of
https://github.com/redis/go-redis.git
synced 2025-06-11 03:21:38 +03:00
Remove unused func.
This commit is contained in:
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user