bump go-structr to v0.8.9 (returns early if zero uncached keys to be loaded)

This commit is contained in:
kim 2024-09-12 18:24:24 +01:00
commit 83d8b0680a
6 changed files with 11 additions and 5 deletions

View file

@ -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 {