refactor: reduce indent
This commit is contained in:
1 parent
3269d91b7c
commit
f9f29bbe42
1 file changed
+15
-16
+15
-16
@@ -286,23 +286,22 @@ func (peer *Peer) handleAddConnection(conn *LocalConnection) {
|
|||||||
if dupConn, found := peer.connections[toName]; found {
|
if dupConn, found := peer.connections[toName]; found {
|
||||||
if dupConn == conn {
|
if dupConn == conn {
|
||||||
return
|
return
|
||||||
|
}
|
||||||
|
// conn.UID is used as the tie breaker here, in the
|
||||||
|
// knowledge that both sides will make the same decision.
|
||||||
|
dupConnLocal := dupConn.(*LocalConnection)
|
||||||
|
if conn.UID == dupConnLocal.UID {
|
||||||
|
// oh good grief. Sod it, just kill both of them.
|
||||||
|
conn.CheckFatal(dupErr)
|
||||||
|
dupConnLocal.CheckFatal(dupErr)
|
||||||
|
peer.handleDeleteConnection(dupConnLocal)
|
||||||
|
return
|
||||||
|
} else if conn.UID < dupConnLocal.UID {
|
||||||
|
dupConnLocal.CheckFatal(dupErr)
|
||||||
|
peer.handleDeleteConnection(dupConnLocal)
|
||||||
} else {
|
} else {
|
||||||
// conn.UID is used as the tie breaker here, in the
|
conn.CheckFatal(dupErr)
|
||||||
// knowledge that both sides will make the same decision.
|
return
|
||||||
dupConnLocal := dupConn.(*LocalConnection)
|
|
||||||
if conn.UID == dupConnLocal.UID {
|
|
||||||
// oh good grief. Sod it, just kill both of them.
|
|
||||||
conn.CheckFatal(dupErr)
|
|
||||||
dupConnLocal.CheckFatal(dupErr)
|
|
||||||
peer.handleDeleteConnection(dupConnLocal)
|
|
||||||
return
|
|
||||||
} else if conn.UID < dupConnLocal.UID {
|
|
||||||
dupConnLocal.CheckFatal(dupErr)
|
|
||||||
peer.handleDeleteConnection(dupConnLocal)
|
|
||||||
} else {
|
|
||||||
conn.CheckFatal(dupErr)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := peer.checkConnectionLimit(); err != nil {
|
if err := peer.checkConnectionLimit(); err != nil {
|
||||||
|
|||||||
Reference in new issue
Block a user