1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 09:00:55 +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 {
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.