Return PeerMap by reference.
In accordance with `go vet`, locks should only be returned by reference.
This commit is contained in:
parent
d46beb0f7d
commit
d754b5b376
2 changed files with 4 additions and 4 deletions
|
@ -96,8 +96,8 @@ type Torrent struct {
|
|||
ID uint64 `json:"id"`
|
||||
Infohash string `json:"infohash"`
|
||||
|
||||
Seeders PeerMap `json:"seeders"`
|
||||
Leechers PeerMap `json:"leechers"`
|
||||
Seeders *PeerMap `json:"seeders"`
|
||||
Leechers *PeerMap `json:"leechers"`
|
||||
|
||||
Snatches uint64 `json:"snatches"`
|
||||
UpMultiplier float64 `json:"up_multiplier"`
|
||||
|
|
|
@ -24,8 +24,8 @@ type PeerMap struct {
|
|||
}
|
||||
|
||||
// NewPeerMap initializes the map for a new PeerMap.
|
||||
func NewPeerMap(seeders bool, cfg *config.Config) PeerMap {
|
||||
pm := PeerMap{
|
||||
func NewPeerMap(seeders bool, cfg *config.Config) *PeerMap {
|
||||
pm := &PeerMap{
|
||||
Peers: make(map[string]map[PeerKey]Peer),
|
||||
Seeders: seeders,
|
||||
Config: cfg.NetConfig.SubnetConfig,
|
||||
|
|
Loading…
Reference in a new issue