Commit d736d0ca authored by Faissal Elamraoui's avatar Faissal Elamraoui

Adds Count method to BeeMap struct

This adds a Count() method to BeeMap struct that returns the number of
items within the safe map.
parent 99093693
......@@ -84,3 +84,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)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment