From 6bebce0b5a3d209b928eb2b13d17c7ddf3851675 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Tue, 2 Feb 2016 14:03:01 +0000 Subject: [PATCH] tiny refactor --- ipam/allocator.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ipam/allocator.go b/ipam/allocator.go index 3b1f80ac..6abd3d92 100644 --- a/ipam/allocator.go +++ b/ipam/allocator.go @@ -276,13 +276,12 @@ func (alloc *Allocator) Delete(ident string) error { func (alloc *Allocator) delete(ident string) error { addrs := alloc.removeAllOwned(ident) - for _, addr := range addrs { - alloc.space.Free(addr) - } - if len(addrs) == 0 { return fmt.Errorf("Delete: no addresses for %s", ident) } + for _, addr := range addrs { + alloc.space.Free(addr) + } return nil }