utils: fix the safemap Items

This commit is contained in:
astaxie 2014-07-26 23:25:51 +08:00
parent ee9749d640
commit e7fcb824c1
1 changed files with 5 additions and 1 deletions

View File

@ -72,5 +72,9 @@ func (m *BeeMap) Delete(k interface{}) {
func (m *BeeMap) Items() map[interface{}]interface{} {
m.lock.RLock()
defer m.lock.RUnlock()
return m.bm
r := make(map[interface{}]interface{})
for k, v := range m.bm {
r[k] = v
}
return r
}