Skip to content

Commit

Permalink
Always use sync.Map as pointer to please el Jonathan
Browse files Browse the repository at this point in the history
  • Loading branch information
wizeguyy committed Apr 29, 2024
1 parent 6c0b4e2 commit 0a1818a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions p2p/requestManager/requestManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ func (m *requestIDMap) delete(id uint32) {
// RequestIDManager is a singleton that manages request IDs
type requestIDManager struct {
mu sync.Mutex
activeRequests requestIDMap
activeRequests *requestIDMap
}

// Returns the singleton RequestIDManager
func NewManager() RequestManager {
return &requestIDManager{
mu: sync.Mutex{},
activeRequests: requestIDMap{},
activeRequests: new(requestIDMap),
}
}

Expand Down

0 comments on commit 0a1818a

Please sign in to comment.