From 72e134605c0f8862a2e0b3f59bed0247cb592ba5 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Tue, 26 Apr 2016 20:02:47 +0100 Subject: [PATCH] refactor: move pure code outside actor --- ipam/allocator.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ipam/allocator.go b/ipam/allocator.go index 478c6545..f3388a67 100644 --- a/ipam/allocator.go +++ b/ipam/allocator.go @@ -321,11 +321,11 @@ func (alloc *Allocator) ContainerStarted(ident string) { } func (alloc *Allocator) PruneOwned(ids []string) { + idmap := make(map[string]struct{}, len(ids)) + for _, id := range ids { + idmap[id] = struct{}{} + } alloc.actionChan <- func() { - idmap := make(map[string]struct{}, len(ids)) - for _, id := range ids { - idmap[id] = struct{}{} - } alloc.pruneOwned(idmap) } }