mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-08 17:33:22 -06:00
remove zero checks in uncached key load functions (go-structr now handles this)
This commit is contained in:
parent
83d8b0680a
commit
bca5e1b926
20 changed files with 21 additions and 167 deletions
|
|
@ -54,15 +54,8 @@ func (s *statusDB) GetStatusesByIDs(ctx context.Context, ids []string) ([]*gtsmo
|
|||
statuses, err := s.state.Caches.DB.Status.LoadIDs("ID",
|
||||
ids,
|
||||
func(uncached []string) ([]*gtsmodel.Status, error) {
|
||||
// Avoid querying
|
||||
// if none uncached.
|
||||
count := len(uncached)
|
||||
if count == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// Preallocate expected length of uncached statuses.
|
||||
statuses := make([]*gtsmodel.Status, 0, count)
|
||||
statuses := make([]*gtsmodel.Status, 0, len(uncached))
|
||||
|
||||
// Perform database query scanning
|
||||
// the remaining (uncached) status IDs.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue