Skip to content

Commit

Permalink
don't need to check nil value on get func (#7)
Browse files Browse the repository at this point in the history
Co-authored-by: prpeh <[email protected]>
  • Loading branch information
hadv and prpeh authored Jun 13, 2024
1 parent b63c645 commit d52d0de
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions ringcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ func (c *RingCache) Add(key, value interface{}) (evicted bool) {
// Get looks up a key's value from the cache.
func (c *RingCache) Get(key interface{}) (interface{}, bool) {
if value, ok := c.items[key]; ok {
if value == nil {
return nil, false
}
return value, ok
}
return nil, false
Expand Down

0 comments on commit d52d0de

Please sign in to comment.