More key tweaks (#1116)

This commit is contained in:
Neil Alexander 2020-06-12 11:07:26 +01:00 committed by GitHub
parent ec7718e7f8
commit 079d8fe8fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 16 deletions

View file

@ -68,6 +68,13 @@ func (c *InMemoryLRUCachePartition) Set(key string, value interface{}) {
c.lru.Add(key, value)
}
func (c *InMemoryLRUCachePartition) Unset(key string) {
if !c.mutable {
panic(fmt.Sprintf("invalid use of immutable cache tries to unset value of %q", key))
}
c.lru.Remove(key)
}
func (c *InMemoryLRUCachePartition) Get(key string) (value interface{}, ok bool) {
return c.lru.Get(key)
}