diff options
Diffstat (limited to 'vendor/codeberg.org')
-rw-r--r-- | vendor/codeberg.org/gruf/go-structr/cache.go | 5 | ||||
-rw-r--r-- | vendor/codeberg.org/gruf/go-structr/item.go | 1 | ||||
-rw-r--r-- | vendor/codeberg.org/gruf/go-structr/runtime.go | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/vendor/codeberg.org/gruf/go-structr/cache.go b/vendor/codeberg.org/gruf/go-structr/cache.go index 8fcd4fec4..e73db58f8 100644 --- a/vendor/codeberg.org/gruf/go-structr/cache.go +++ b/vendor/codeberg.org/gruf/go-structr/cache.go @@ -375,6 +375,11 @@ func (c *Cache[T]) Load(index *Index, keys []Key, load func([]Key) ([]T, error)) // the lock. unlock() + if len(keys) == 0 { + // We loaded everything! + return values, nil + } + // Load uncached values. uncached, err := load(keys) if err != nil { diff --git a/vendor/codeberg.org/gruf/go-structr/item.go b/vendor/codeberg.org/gruf/go-structr/item.go index 97079c378..bf83f1444 100644 --- a/vendor/codeberg.org/gruf/go-structr/item.go +++ b/vendor/codeberg.org/gruf/go-structr/item.go @@ -41,7 +41,6 @@ func free_indexed_item(item *indexed_item) { } // drop_index will drop the given index entry from item's indexed. -// note this also handles freeing the index_entry memory (e.g. to pool) func (i *indexed_item) drop_index(entry *index_entry) { for x := 0; x < len(i.indexed); x++ { if i.indexed[x] != entry { diff --git a/vendor/codeberg.org/gruf/go-structr/runtime.go b/vendor/codeberg.org/gruf/go-structr/runtime.go index 44fdd74a7..d2bdba380 100644 --- a/vendor/codeberg.org/gruf/go-structr/runtime.go +++ b/vendor/codeberg.org/gruf/go-structr/runtime.go @@ -152,8 +152,10 @@ func extract_fields(ptr unsafe.Pointer, fields []struct_field) []unsafe.Pointer fptr = field.zero } + // Set field ptr. ptrs[i] = fptr } + return ptrs } |