Rename `mergedNomadMap` to `mergedPrimaryMap`. Gratuitous, but more correct.

This commit is contained in:
Sean Chittenden 2016-05-26 13:28:45 -07:00
parent f695d6d70d
commit af96cb23a5
No known key found for this signature in database
GPG Key ID: 4EBC9DC16C2E5E16
1 changed files with 6 additions and 6 deletions

View File

@ -651,10 +651,10 @@ func (p *RpcProxy) UpdateFromNodeUpdateResponse(resp *structs.NodeUpdateResponse
// 'n' == new // 'n' == new
state byte state byte
} }
mergedNomadMap := make(map[EndpointKey]*targetServer, len(p.primaryServers.L)+len(resp.Servers)) mergedPrimaryMap := make(map[EndpointKey]*targetServer, len(p.primaryServers.L)+len(resp.Servers))
numOldServers := 0 numOldServers := 0
for _, s := range p.primaryServers.L { for _, s := range p.primaryServers.L {
mergedNomadMap[*s.Key()] = &targetServer{server: s, state: 'o'} mergedPrimaryMap[*s.Key()] = &targetServer{server: s, state: 'o'}
numOldServers++ numOldServers++
} }
numBothServers := 0 numBothServers := 0
@ -685,12 +685,12 @@ func (p *RpcProxy) UpdateFromNodeUpdateResponse(resp *structs.NodeUpdateResponse
} }
k := server.Key() k := server.Key()
_, found := mergedNomadMap[*k] _, found := mergedPrimaryMap[*k]
if found { if found {
mergedNomadMap[*k].state = 'b' mergedPrimaryMap[*k].state = 'b'
numBothServers++ numBothServers++
} else { } else {
mergedNomadMap[*k] = &targetServer{server: server, state: 'n'} mergedPrimaryMap[*k] = &targetServer{server: server, state: 'n'}
newServers = true newServers = true
} }
} }
@ -703,7 +703,7 @@ func (p *RpcProxy) UpdateFromNodeUpdateResponse(resp *structs.NodeUpdateResponse
p.listLock.Lock() p.listLock.Lock()
defer p.listLock.Unlock() defer p.listLock.Unlock()
newServerCfg := p.getServerList() newServerCfg := p.getServerList()
for k, v := range mergedNomadMap { for k, v := range mergedPrimaryMap {
switch v.state { switch v.state {
case 'b': case 'b':
// Do nothing, server exists in both // Do nothing, server exists in both