refactor: unnecessary guard check

This commit is contained in:
piglig
2023-07-01 11:16:24 +08:00
parent af3ecc1cef
commit 53148862bc
-2
View File
@@ -228,10 +228,8 @@ func (s *Session) UnSet(key string) {
s.rwmutex.Lock() s.rwmutex.Lock()
defer s.rwmutex.Unlock() defer s.rwmutex.Unlock()
if s.Keys != nil { if s.Keys != nil {
if _, exists := s.Keys[key]; exists {
delete(s.Keys, key) delete(s.Keys, key)
} }
}
} }
// IsClosed returns the status of the connection. // IsClosed returns the status of the connection.