mirror of
https://github.com/minio/minio.git
synced 2025-01-13 16:03:21 -05:00
Merge pull request #575 from fkautz/pr_out_fixing_panic_in_intelligent_attempted_to_delete_nonexistent_key
This commit is contained in:
commit
0266ec4bf6
@ -134,12 +134,14 @@ func (r *Intelligent) Set(key string, value interface{}) {
|
||||
|
||||
// Delete deletes a given key if exists
|
||||
func (r *Intelligent) Delete(key string) {
|
||||
r.currentSize -= uint64(len(r.items[key].([]byte)))
|
||||
delete(r.items, key)
|
||||
delete(r.updatedAt, key)
|
||||
r.totalEvicted++
|
||||
if r.OnEvicted != nil {
|
||||
r.OnEvicted(key)
|
||||
if _, ok := r.items[key]; ok {
|
||||
r.currentSize -= uint64(len(r.items[key].([]byte)))
|
||||
delete(r.items, key)
|
||||
delete(r.updatedAt, key)
|
||||
r.totalEvicted++
|
||||
if r.OnEvicted != nil {
|
||||
r.OnEvicted(key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user