mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
p2p: prealloc slice
This commit is contained in:
parent
d4a3bf1b23
commit
1837af6ab9
1 changed files with 1 additions and 1 deletions
|
|
@ -561,7 +561,7 @@ type PeerInfo struct {
|
||||||
// Info gathers and returns a collection of metadata known about a peer.
|
// Info gathers and returns a collection of metadata known about a peer.
|
||||||
func (p *Peer) Info() *PeerInfo {
|
func (p *Peer) Info() *PeerInfo {
|
||||||
// Gather the protocol capabilities
|
// Gather the protocol capabilities
|
||||||
var caps []string
|
caps := make([]string, 0, len(p.Caps()))
|
||||||
for _, cap := range p.Caps() {
|
for _, cap := range p.Caps() {
|
||||||
caps = append(caps, cap.String())
|
caps = append(caps, cap.String())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue