From e7fcb824c1c9de556f29f922b1a49dff2309668e Mon Sep 17 00:00:00 2001 From: astaxie Date: Sat, 26 Jul 2014 23:25:51 +0800 Subject: [PATCH] utils: fix the safemap Items --- utils/safemap.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/safemap.go b/utils/safemap.go index 27c63eba..e99aceee 100644 --- a/utils/safemap.go +++ b/utils/safemap.go @@ -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 }