libnetwork: change netWatch map to a set
The map keys are only tested for presence. The value stored at the keys is unused. Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
parent
0456c0db87
commit
29da565133
1 changed files with 3 additions and 3 deletions
|
@ -185,7 +185,7 @@ retry:
|
|||
}
|
||||
|
||||
type netWatch struct {
|
||||
localEps map[string]*Endpoint
|
||||
localEps map[string]struct{}
|
||||
}
|
||||
|
||||
func (c *Controller) watchSvcRecord(ep *Endpoint) {
|
||||
|
@ -212,9 +212,9 @@ func (c *Controller) processEndpointCreate(ep *Endpoint) {
|
|||
c.mu.Lock()
|
||||
_, ok := c.nmap[networkID]
|
||||
if !ok {
|
||||
c.nmap[networkID] = &netWatch{localEps: make(map[string]*Endpoint)}
|
||||
c.nmap[networkID] = &netWatch{localEps: make(map[string]struct{})}
|
||||
}
|
||||
c.nmap[networkID].localEps[endpointID] = ep
|
||||
c.nmap[networkID].localEps[endpointID] = struct{}{}
|
||||
c.mu.Unlock()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue