summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf/go-structr/cache.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-09-28 20:47:46 +0000
committerLibravatar GitHub <noreply@github.com>2024-09-28 22:47:46 +0200
commit095663f5ccd10a4cd04ef6ad836f37346fc748ae (patch)
tree2a0c5a6f2d958fcf88501776013485b987766701 /vendor/codeberg.org/gruf/go-structr/cache.go
parent[chore] use string formatting package agnostic way of printing request attemp... (diff)
downloadgotosocial-095663f5ccd10a4cd04ef6ad836f37346fc748ae.tar.xz
[bugfix] visibility after implicit approval not getting invalidated (#3370)
* replicate issue * update go-structr to v0.8.10 with internal linked-list fix, small tweaks to caching of interaction requests * remove debug function --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Diffstat (limited to 'vendor/codeberg.org/gruf/go-structr/cache.go')
-rw-r--r--vendor/codeberg.org/gruf/go-structr/cache.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/vendor/codeberg.org/gruf/go-structr/cache.go b/vendor/codeberg.org/gruf/go-structr/cache.go
index e73db58f8..4bea32c89 100644
--- a/vendor/codeberg.org/gruf/go-structr/cache.go
+++ b/vendor/codeberg.org/gruf/go-structr/cache.go
@@ -575,8 +575,9 @@ func (c *Cache[T]) store_value(index *Index, key string, value T) {
item.data = value
if index != nil {
- // Append item to index.
- index.append(key, item)
+ // Append item to index a key
+ // was already generated for.
+ index.append(&c.lru, key, item)
}
// Get ptr to value data.
@@ -607,8 +608,8 @@ func (c *Cache[T]) store_value(index *Index, key string, value T) {
continue
}
- // Append item to index.
- idx.append(key, item)
+ // Append item to this index.
+ idx.append(&c.lru, key, item)
}
// Add item to main lru list.
@@ -645,8 +646,9 @@ func (c *Cache[T]) store_error(index *Index, key string, err error) {
// Set error val.
item.data = err
- // Append item to index.
- index.append(key, item)
+ // Append item to index a key
+ // was already generated for.
+ index.append(&c.lru, key, item)
// Add item to main lru list.
c.lru.push_front(&item.elem)