1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 14:20:54 +00:00

Removes redundant check if key exists in BeeMap

This commit is contained in:
Faissal Elamraoui 2016-12-29 11:05:35 +01:00
parent 75ec8d33a2
commit fe21305bb3

View File

@ -61,10 +61,8 @@ func (m *BeeMap) Set(k interface{}, v interface{}) bool {
func (m *BeeMap) Check(k interface{}) bool { func (m *BeeMap) Check(k interface{}) bool {
m.lock.RLock() m.lock.RLock()
defer m.lock.RUnlock() defer m.lock.RUnlock()
if _, ok := m.bm[k]; !ok { _, ok := m.bm[k]
return false return ok
}
return true
} }
// Delete the given key and value. // Delete the given key and value.