mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 20:00:55 +00:00
Removes redundant check if key exists in BeeMap
This commit is contained in:
parent
75ec8d33a2
commit
fe21305bb3
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user