1
0
mirror of https://github.com/beego/bee.git synced 2025-06-14 18:40:39 +00:00
This commit is contained in:
astaxie
2017-03-17 13:33:15 +08:00
parent 20c6a26952
commit dd3f690bf7
96 changed files with 865 additions and 8639 deletions

View File

@ -61,10 +61,8 @@ func (m *BeeMap) Set(k interface{}, v interface{}) bool {
func (m *BeeMap) Check(k interface{}) bool {
m.lock.RLock()
defer m.lock.RUnlock()
if _, ok := m.bm[k]; !ok {
return false
}
return true
_, ok := m.bm[k]
return ok
}
// Delete the given key and value.
@ -84,3 +82,10 @@ func (m *BeeMap) Items() map[interface{}]interface{} {
}
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)
}