mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-14 14:08:19 +00:00
Is len(map) threadsafe? (#3535)
This commit is contained in:
parent
9fcc6fc201
commit
37596ac188
@ -35,6 +35,8 @@ func Delete(pid peer.ID) {
|
||||
|
||||
// Count of peer statuses in cache. Threadsafe.
|
||||
func Count() int {
|
||||
lock.RLock()
|
||||
defer lock.RUnlock()
|
||||
return len(peerStatuses)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user