From 67e9310cc18f9edfc03d20a1fd2731e23f814178 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Tue, 3 Nov 2015 17:00:24 +0000 Subject: [PATCH] Review feedback --- ipam/allocator.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ipam/allocator.go b/ipam/allocator.go index d52ba6d3..05fdcda1 100644 --- a/ipam/allocator.go +++ b/ipam/allocator.go @@ -55,8 +55,8 @@ type Allocator struct { paxos *paxos.Node paxosTicker *time.Ticker shuttingDown bool // to avoid doing any requests while trying to shut down - now func() time.Time isKnownPeer func(router.PeerName) bool + now func() time.Time } // NewAllocator creates and initialises a new Allocator @@ -68,8 +68,8 @@ func NewAllocator(ourName router.PeerName, ourUID router.PeerUID, ourNickname st owned: make(map[string][]address.Address), paxos: paxos.NewNode(ourName, ourUID, quorum), nicknames: map[router.PeerName]string{ourName: ourNickname}, - now: time.Now, isKnownPeer: isKnownPeer, + now: time.Now, } } @@ -311,8 +311,7 @@ func (alloc *Allocator) Shutdown() { alloc.shuttingDown = true alloc.cancelOps(&alloc.pendingClaims) alloc.cancelOps(&alloc.pendingAllocates) - heir := alloc.pickPeerForTransfer() - if heir != router.UnknownPeerName { + if heir := alloc.pickPeerForTransfer(); heir != router.UnknownPeerName { alloc.ring.Transfer(alloc.ourName, heir) alloc.space.Clear() alloc.gossip.GossipBroadcast(alloc.Gossip())