ax(node): rename n to connectionCount in ConnectedPeers usage example
AX Principle 1: predictable names over short names. The comment example used `n` which requires context to understand; `connectionCount` is self-documenting. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
a8b2dad8ec
commit
e69816f978
1 changed files with 2 additions and 2 deletions
|
|
@ -930,8 +930,8 @@ func (t *Transport) decryptMessage(data []byte, sharedSecret []byte) (*Message,
|
|||
return &msg, nil
|
||||
}
|
||||
|
||||
// n := transport.ConnectedPeers()
|
||||
// if n == 0 { return ErrNoPeers }
|
||||
// connectionCount := transport.ConnectedPeers()
|
||||
// if connectionCount == 0 { return ErrNoPeers }
|
||||
func (t *Transport) ConnectedPeers() int {
|
||||
t.mutex.RLock()
|
||||
defer t.mutex.RUnlock()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue