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:
Sean Chittenden 2016-03-25 13:08:08 -07:00
parent 9c18bb5f1c
commit d9251e30c8
1 changed files with 1 additions and 2 deletions

View File

@ -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]...)