mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
refactor(filters): optimize assignment to allocation (#1293)
nit(filters): move explicit assignment to allocation
This commit is contained in:
parent
fef1af08c4
commit
3580472cbd
1 changed files with 38 additions and 38 deletions
|
@ -633,6 +633,8 @@ func (r *FilterRepo) findByIndexerIdentifier(ctx context.Context, indexer string
|
||||||
return nil, errors.Wrap(err, "error scanning row")
|
return nil, errors.Wrap(err, "error scanning row")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filter, ok := filtersMap[f.ID]
|
||||||
|
if !ok {
|
||||||
f.MinSize = minSize.String
|
f.MinSize = minSize.String
|
||||||
f.MaxSize = maxSize.String
|
f.MaxSize = maxSize.String
|
||||||
f.Delay = int(delay.Int32)
|
f.Delay = int(delay.Int32)
|
||||||
|
@ -671,8 +673,6 @@ func (r *FilterRepo) findByIndexerIdentifier(ctx context.Context, indexer string
|
||||||
|
|
||||||
f.Rejections = []string{}
|
f.Rejections = []string{}
|
||||||
|
|
||||||
filter, ok := filtersMap[f.ID]
|
|
||||||
if !ok {
|
|
||||||
filter = &f
|
filter = &f
|
||||||
filtersMap[f.ID] = filter
|
filtersMap[f.ID] = filter
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue