fix(decaymap): invert locking process for Delete

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso 2025-07-03 04:50:11 +00:00
parent acee62a9d0
commit ddb7b0e99e
No known key found for this signature in database

View File

@ -61,9 +61,9 @@ func (m *Impl[K, V]) Delete(key K) bool {
return false
}
m.lock.Unlock()
delete(m.data, key)
m.lock.Lock()
delete(m.data, key)
m.lock.Unlock()
return true
}