Permalink
Browse files

refactor(peer): cleanup of some if boolean logic

I always get confused reading this code. Lets make it more clear, if
flush then flush; else don't flush.
  • Loading branch information...
1 parent b60b8b9 commit 36556bf8e0bce4ab6d26eafacbdad04d9614a5d7 @philips philips committed Feb 7, 2014
Showing with 4 additions and 4 deletions.
  1. +4 −4 peer.go
View
@@ -123,15 +123,15 @@ func (p *Peer) heartbeat(c chan bool) {
for {
select {
case flush := <-stopChan:
- if !flush {
- debugln("peer.heartbeat.stop: ", p.Name)
- return
- } else {
+ if flush {
// before we can safely remove a node
// we must flush the remove command to the node first
p.flush()
debugln("peer.heartbeat.stop.with.flush: ", p.Name)
return
+ } else {
+ debugln("peer.heartbeat.stop: ", p.Name)
+ return
}
case <-ticker:

0 comments on commit 36556bf

Please sign in to comment.