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
1 changed files with 2 additions and 4 deletions

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.