mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-04 14:13:16 -06:00
bump go-structr to v0.8.9 (returns early if zero uncached keys to be loaded)
This commit is contained in:
parent
e5c27a9fea
commit
83d8b0680a
6 changed files with 11 additions and 5 deletions
5
vendor/codeberg.org/gruf/go-structr/cache.go
generated
vendored
5
vendor/codeberg.org/gruf/go-structr/cache.go
generated
vendored
|
|
@ -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 {
|
||||
|
|
|
|||
1
vendor/codeberg.org/gruf/go-structr/item.go
generated
vendored
1
vendor/codeberg.org/gruf/go-structr/item.go
generated
vendored
|
|
@ -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 {
|
||||
|
|
|
|||
2
vendor/codeberg.org/gruf/go-structr/runtime.go
generated
vendored
2
vendor/codeberg.org/gruf/go-structr/runtime.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue