mirror of https://github.com/status-im/consul.git
Use range vs for
Returning a new array vs mutating an array in place so we can use range now.
This commit is contained in:
parent
9c18bb5f1c
commit
d9251e30c8
|
@ -260,8 +260,7 @@ func (sm *ServerManager) RemoveServer(server *server_details.ServerDetails) {
|
|||
serverCfg := sm.getServerConfig()
|
||||
|
||||
// Remove the server if known
|
||||
n := len(serverCfg.servers)
|
||||
for i := 0; i < n; i++ {
|
||||
for i, _ := range serverCfg.servers {
|
||||
if serverCfg.servers[i].Name == server.Name {
|
||||
newServers := make([]*server_details.ServerDetails, 0, len(serverCfg.servers)-1)
|
||||
newServers = append(newServers, serverCfg.servers[:i]...)
|
||||
|
|
Loading…
Reference in New Issue