From fe21305bb3eae3ec585a7ae8d7955112d3fe94e8 Mon Sep 17 00:00:00 2001 From: Faissal Elamraoui Date: Thu, 29 Dec 2016 11:05:35 +0100 Subject: [PATCH] Removes redundant check if key exists in BeeMap --- utils/safemap.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/utils/safemap.go b/utils/safemap.go index a834a55a..1793030a 100644 --- a/utils/safemap.go +++ b/utils/safemap.go @@ -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.