mirror of
https://github.com/miniflux/v2.git
synced 2025-08-16 18:01:37 +00:00
refactor(model): remove some indirection
For small fixed-size structures, it's better to use a slice of values, instead of a slice of pointers to values: they're stored contiguously and thus can be iterated on quickly by the CPU, and it does remove an indirection per object every time the GC kicks in.
This commit is contained in:
parent
1e6d227e40
commit
8bca777a6d
6 changed files with 12 additions and 9 deletions
|
@ -62,7 +62,7 @@ func (s *Storage) APIKeys(userID int64) (model.APIKeys, error) {
|
|||
return nil, fmt.Errorf(`store: unable to fetch API Key row: %v`, err)
|
||||
}
|
||||
|
||||
apiKeys = append(apiKeys, &apiKey)
|
||||
apiKeys = append(apiKeys, apiKey)
|
||||
}
|
||||
|
||||
return apiKeys, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue