From c202d4c1b0894b396bff1b641f2869caa810ebed Mon Sep 17 00:00:00 2001 From: Ryan Russell Date: Thu, 15 Sep 2022 05:12:13 -0500 Subject: [PATCH] refactor(master_grpc_server_cluster): `seletedSet` -> `selectedSet` (#3693) Signed-off-by: Ryan Russell Signed-off-by: Ryan Russell --- weed/server/master_grpc_server_cluster.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/weed/server/master_grpc_server_cluster.go b/weed/server/master_grpc_server_cluster.go index e68238caa..417098c56 100644 --- a/weed/server/master_grpc_server_cluster.go +++ b/weed/server/master_grpc_server_cluster.go @@ -57,15 +57,15 @@ func limitTo(nodes []*cluster.ClusterNode, limit int32) (selected []*cluster.Clu if limit <= 0 || len(nodes) < int(limit) { return nodes } - seletedSet := make(map[pb.ServerAddress]*cluster.ClusterNode) + selectedSet := make(map[pb.ServerAddress]*cluster.ClusterNode) for i := 0; i < int(limit)*3; i++ { x := rand.Intn(len(nodes)) - if _, found := seletedSet[nodes[x].Address]; found { + if _, found := selectedSet[nodes[x].Address]; found { continue } - seletedSet[nodes[x].Address] = nodes[x] + selectedSet[nodes[x].Address] = nodes[x] } - for _, node := range seletedSet { + for _, node := range selectedSet { selected = append(selected, node) } return