ax(node): rename single-letter goroutine parameter p to connectedPeer
AX Principle 1: predictable names over short names. The goroutine parameter in GetAllStats used `p *Peer` — a single-letter abbreviation with no justification under the AX exception list (i, _, t, c only). Renamed to `connectedPeer` to match the variable's semantic role. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
271f3c2580
commit
cbc876fdaf
1 changed files with 5 additions and 5 deletions
|
|
@ -255,19 +255,19 @@ func (c *Controller) GetAllStats() map[string]*StatsPayload {
|
|||
|
||||
for _, peer := range peers {
|
||||
waitGroup.Add(1)
|
||||
go func(p *Peer) {
|
||||
go func(connectedPeer *Peer) {
|
||||
defer waitGroup.Done()
|
||||
stats, err := c.GetRemoteStats(p.ID)
|
||||
stats, err := c.GetRemoteStats(connectedPeer.ID)
|
||||
if err != nil {
|
||||
logging.Debug("failed to get stats from peer", logging.Fields{
|
||||
"peer_id": p.ID,
|
||||
"peer": p.Name,
|
||||
"peer_id": connectedPeer.ID,
|
||||
"peer": connectedPeer.Name,
|
||||
"error": err.Error(),
|
||||
})
|
||||
return // Skip failed peers
|
||||
}
|
||||
resultsMutex.Lock()
|
||||
results[p.ID] = stats
|
||||
results[connectedPeer.ID] = stats
|
||||
resultsMutex.Unlock()
|
||||
}(peer)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue