mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-14 19:20:37 +03:00
Combined multiple appends into a single one (#1464)
This commit is contained in:
parent
023d7bfa8a
commit
da26c5cfe0
@ -161,8 +161,10 @@ func (itr InTheRange) ToSql() (sql string, args []interface{}, err error) {
|
|||||||
if s.Kind() != reflect.Slice || s.Len() != 2 {
|
if s.Kind() != reflect.Slice || s.Len() != 2 {
|
||||||
return "", nil, fmt.Errorf("invalid range for 'in' operator: %s", v)
|
return "", nil, fmt.Errorf("invalid range for 'in' operator: %s", v)
|
||||||
}
|
}
|
||||||
and = append(and, squirrel.GtOrEq{f: s.Index(0).Interface()})
|
and = append(and,
|
||||||
and = append(and, squirrel.LtOrEq{f: s.Index(1).Interface()})
|
squirrel.GtOrEq{f: s.Index(0).Interface()},
|
||||||
|
squirrel.LtOrEq{f: s.Index(1).Interface()},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
return and.ToSql()
|
return and.ToSql()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user