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
@@ -182,14 +182,14 @@ func (conn *LocalConnection) queryLoop(queryChan <-chan *ConnectionInteraction,
if !ok {
break
}
switch {
case query.code == CShutdown:
switch query.code {
case CShutdown:
terminate = true
case query.code == CSetEstablished:
case CSetEstablished:
err = conn.handleSetEstablished()
case query.code == CSetRemoteUDPAddr:
case CSetRemoteUDPAddr:
err = conn.handleSetRemoteUDPAddr(query.payload.(*net.UDPAddr))
case query.code == CSendTCP:
case CSendTCP:
err = conn.handleSendTCP(query.payload.([]byte))
}
}