mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 18:50:54 +00:00
Adds Count method to BeeMap struct
This adds a Count() method to BeeMap struct that returns the number of items within the safe map.
This commit is contained in:
parent
99093693c8
commit
d736d0ca87
@ -84,3 +84,10 @@ func (m *BeeMap) Items() map[interface{}]interface{} {
|
|||||||
}
|
}
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Count returns the number of items within the map.
|
||||||
|
func (m *BeeMap) Count() int {
|
||||||
|
m.lock.RLock()
|
||||||
|
defer m.lock.RUnlock()
|
||||||
|
return len(m.bm)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user