diff options
author | 2025-03-09 17:47:56 +0100 | |
---|---|---|
committer | 2025-03-10 01:59:49 +0100 | |
commit | 3ac1ee16f377d31a0fb80c8dae28b6239ac4229e (patch) | |
tree | f61faa581feaaeaba2542b9f2b8234a590684413 /vendor/github.com/quasoft/memstore/cache.go | |
parent | [chore] update URLs to forked source (diff) | |
download | gotosocial-3ac1ee16f377d31a0fb80c8dae28b6239ac4229e.tar.xz |
[chore] remove vendor
Diffstat (limited to 'vendor/github.com/quasoft/memstore/cache.go')
-rw-r--r-- | vendor/github.com/quasoft/memstore/cache.go | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/vendor/github.com/quasoft/memstore/cache.go b/vendor/github.com/quasoft/memstore/cache.go deleted file mode 100644 index a61f29621..000000000 --- a/vendor/github.com/quasoft/memstore/cache.go +++ /dev/null @@ -1,40 +0,0 @@ -package memstore - -import ( - "sync" -) - -type cache struct { - data map[string]valueType - mutex sync.RWMutex -} - -func newCache() *cache { - return &cache{ - data: make(map[string]valueType), - } -} - -func (c *cache) value(name string) (valueType, bool) { - c.mutex.RLock() - defer c.mutex.RUnlock() - - v, ok := c.data[name] - return v, ok -} - -func (c *cache) setValue(name string, value valueType) { - c.mutex.Lock() - defer c.mutex.Unlock() - - c.data[name] = value -} - -func (c *cache) delete(name string) { - c.mutex.Lock() - defer c.mutex.Unlock() - - if _, ok := c.data[name]; ok { - delete(c.data, name) - } -} |