ax(node): rename loop variable p to peer in GetPeersByScore
AX Principle 1 — predictable names over short names. Single-letter variable p in GetPeersByScore replaced with peer, matching the type it holds and the usage in surrounding code. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
6d70f4a85f
commit
3cf01162d5
1 changed files with 2 additions and 2 deletions
|
|
@ -464,8 +464,8 @@ func (r *PeerRegistry) GetPeersByScore() []*Peer {
|
|||
defer r.mutex.RUnlock()
|
||||
|
||||
peers := make([]*Peer, 0, len(r.peers))
|
||||
for _, p := range r.peers {
|
||||
peers = append(peers, p)
|
||||
for _, peer := range r.peers {
|
||||
peers = append(peers, peer)
|
||||
}
|
||||
|
||||
// Sort by score descending
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue