refactor: use better 'switch'

This commit is contained in:
Matthias Radestock committed 2014-09-22 22:34:46 +01:00
1 parent f11f84fe17
commit d5e797f695
4 files changed
+19 -19

No files matched your search

+5 -5
View File
@@ -259,15 +259,15 @@ func (peer *Peer) queryLoop(queryChan <-chan *PeerInteraction) {
if !ok {
return
}
switch {
case query.code == PAddConnection:
switch query.code {
case PAddConnection:
peer.handleAddConnection(query.payload.(*LocalConnection))
case query.code == PDeleteConnection:
case PDeleteConnection:
peer.handleDeleteConnection(query.payload.(*LocalConnection))
query.resultChan <- nil
case query.code == PConnectionEstablished:
case PConnectionEstablished:
peer.handleConnectionEstablished(query.payload.(*LocalConnection))
case query.code == PBroadcastTCP:
case PBroadcastTCP:
peer.handleBroadcastTCP(query.payload.([]byte))
}
}