Skip to content

Commit

Permalink
Merge pull request #230 from topfreegames/feature/change-initial-size…
Browse files Browse the repository at this point in the history
…-get-servers-return-map

Change initial size of get servers return map
  • Loading branch information
gabrielcorado committed Aug 6, 2021
2 parents 11ffeff + efb6836 commit 56a7cf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cluster/etcd_service_discovery.go
Expand Up @@ -304,7 +304,7 @@ func (sd *etcdServiceDiscovery) GetServersByType(serverType string) (map[string]
// Create a new map to avoid concurrent read and write access to the
// map, this also prevents accidental changes to the list of servers
// kept by the service discovery.
ret := make(map[string]*Server, len(sd.serverMapByType))
ret := make(map[string]*Server, len(sd.serverMapByType[serverType]))
for k, v := range sd.serverMapByType[serverType] {
ret[k] = v
}
Expand Down

0 comments on commit 56a7cf9

Please sign in to comment.