diff kitten: Automatically change colors on terminal color scheme change

This commit is contained in:
Kovid Goyal
2025-01-05 06:00:24 +05:30
parent 98c1e0f7aa
commit f3db7e7554
9 changed files with 113 additions and 35 deletions

View File

@@ -22,6 +22,12 @@ func NewLRUCache[K comparable, V any](max_size int) *LRUCache[K, V] {
return &ans
}
func (self *LRUCache[K, V]) Clear() {
self.lock.RLock()
clear(self.data)
self.lock.Unlock()
}
func (self *LRUCache[K, V]) Get(key K) (ans V, found bool) {
self.lock.RLock()
ans, found = self.data[key]