mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Don't mix up capacity and length
- `make([]a, b)` create a slice of `b` elements `a` - `make([]a, b, c)` create a slice of `0` elements `a`, but reserve space for `c` of them When using `append` on the former, it will result on a slice with `b` leading elements, which is unlikely to be what we want. This commit replaces the two instances where this happens with the latter construct.
This commit is contained in:
parent
645a817685
commit
1f5c8ce353
2 changed files with 2 additions and 2 deletions
|
@ -132,7 +132,7 @@ func (s *Storage) updateEnclosures(tx *sql.Tx, entry *model.Entry) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
sqlValues := make([]string, len(entry.Enclosures))
|
||||
sqlValues := make([]string, 0, len(entry.Enclosures))
|
||||
for _, enclosure := range entry.Enclosures {
|
||||
sqlValues = append(sqlValues, strings.TrimSpace(enclosure.URL))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue