refactor: more descriptive function name

This commit is contained in:
Matthias Radestock committed 2016-04-26 17:33:04 +01:00
1 parent 8fdbaf5745
commit 7cc2a1fe38
2 files changed
+4 -4

No files matched your search

+3 -3
View File
@@ -320,13 +320,13 @@ func (alloc *Allocator) ContainerStarted(ident string) {
}
}
func (alloc *Allocator) AllContainerIDs(ids []string) {
func (alloc *Allocator) PruneOwned(ids []string) {
alloc.actionChan <- func() {
idmap := make(map[string]struct{}, len(ids))
for _, id := range ids {
idmap[id] = struct{}{}
}
alloc.syncOwned(idmap)
alloc.pruneOwned(idmap)
}
}
@@ -1004,7 +1004,7 @@ func (alloc *Allocator) findOwner(addr address.Address) string {
}
// For each ID in the 'owned' map, remove the entry if it isn't in the map
func (alloc *Allocator) syncOwned(ids map[string]struct{}) {
func (alloc *Allocator) pruneOwned(ids map[string]struct{}) {
changed := false
for ident, d := range alloc.owned {
if !d.IsContainer {
+1 -1
View File
@@ -304,7 +304,7 @@ func main() {
observeContainers(allocator)
ids, err := dockerCli.AllContainerIDs()
checkFatal(err)
allocator.AllContainerIDs(ids)
allocator.PruneOwned(ids)
}
var (