mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
More key tweaks (#1116)
This commit is contained in:
parent
ec7718e7f8
commit
079d8fe8fb
6 changed files with 29 additions and 16 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue