aboutsummaryrefslogtreecommitdiffstats
path: root/store.go
diff options
context:
space:
mode:
authorMarc Pervaz Boocha <marcpervaz@qburst.com>2025-05-15 17:56:07 +0530
committerMarc Pervaz Boocha <marcpervaz@qburst.com>2025-05-15 17:56:07 +0530
commit7d532553ae18bfff1bec9e0df3fa66313073e3dd (patch)
tree796a7fe86da764f51648b1337011baeaaf53421b /store.go
parentLint and bug fixes (diff)
downloadcache-7d532553ae18bfff1bec9e0df3fa66313073e3dd.tar
cache-7d532553ae18bfff1bec9e0df3fa66313073e3dd.tar.gz
cache-7d532553ae18bfff1bec9e0df3fa66313073e3dd.tar.bz2
cache-7d532553ae18bfff1bec9e0df3fa66313073e3dd.tar.lz
cache-7d532553ae18bfff1bec9e0df3fa66313073e3dd.tar.xz
cache-7d532553ae18bfff1bec9e0df3fa66313073e3dd.tar.zst
cache-7d532553ae18bfff1bec9e0df3fa66313073e3dd.zip
Add raw API
Diffstat (limited to '')
-rw-r--r--store.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/store.go b/store.go
index aa44dc4..ccda46d 100644
--- a/store.go
+++ b/store.go
@@ -228,7 +228,7 @@ func (s *store) Evict() bool {
}
// insert adds a new key-value pair to the store.
-func (s *store) insert(key []byte, value []byte, ttl time.Duration) {
+func (s *store) insert(key, value []byte, ttl time.Duration) {
idx, hash := lookupIdx(s, key)
bucket := &s.Bucket[idx]
@@ -264,7 +264,7 @@ func (s *store) insert(key []byte, value []byte, ttl time.Duration) {
}
// Set adds or updates a key-value pair in the store with locking.
-func (s *store) Set(key []byte, value []byte, ttl time.Duration) {
+func (s *store) Set(key, value []byte, ttl time.Duration) {
s.Lock.Lock()
defer s.Lock.Unlock()