From a6fb885a61d539ac2330fd7005377a96176c315e Mon Sep 17 00:00:00 2001 From: Lisanaaa Date: Mon, 3 Oct 2022 11:38:44 +0800 Subject: [PATCH] Remove useless srvs shuffle We have servers shuffle in `github.com/samuel/go-zookeeper/conn.go:191` and `github.com/samuel/go-zookeeper/dnshostprovider.go:53`, so one of them should be removed. The shuffle logic is more proper to keep inside the real connect component, that's why I choose to remove the outside one. --- conn.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/conn.go b/conn.go index 9afd2d27..73929e53 100644 --- a/conn.go +++ b/conn.go @@ -185,9 +185,6 @@ func Connect(servers []string, sessionTimeout time.Duration, options ...connOpti srvs := FormatServers(servers) - // Randomize the order of the servers to avoid creating hotspots - stringShuffle(srvs) - ec := make(chan Event, eventChanSize) conn := &Conn{ dialer: net.DialTimeout,