diff options
Diffstat (limited to 'vendor/codeberg.org/gruf/go-cache/v3/simple/pool.go')
-rw-r--r-- | vendor/codeberg.org/gruf/go-cache/v3/simple/pool.go | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/vendor/codeberg.org/gruf/go-cache/v3/simple/pool.go b/vendor/codeberg.org/gruf/go-cache/v3/simple/pool.go deleted file mode 100644 index 34ae17546..000000000 --- a/vendor/codeberg.org/gruf/go-cache/v3/simple/pool.go +++ /dev/null @@ -1,23 +0,0 @@ -package simple - -import "sync" - -// entryPool is a global pool for Entry -// objects, regardless of cache type. -var entryPool sync.Pool - -// GetEntry fetches an Entry from pool, or allocates new. -func GetEntry() *Entry { - v := entryPool.Get() - if v == nil { - return new(Entry) - } - return v.(*Entry) -} - -// PutEntry replaces an Entry in the pool. -func PutEntry(e *Entry) { - e.Key = nil - e.Value = nil - entryPool.Put(e) -} |