1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-11 17:51:01 +00:00

Minor concatenation-related simplifications in internal/storage/

Use plain strings concatenation instead of
building an array and then joining it.
This commit is contained in:
jvoisin 2024-03-18 17:35:20 +01:00 committed by Frédéric Guillot
parent 863a5b3648
commit e2ee74428a
3 changed files with 14 additions and 16 deletions

View file

@ -91,25 +91,25 @@ func (f *FeedQueryBuilder) buildCounterCondition() string {
}
func (f *FeedQueryBuilder) buildSorting() string {
var parts []string
var parts string
if len(f.sortExpressions) > 0 {
parts = append(parts, fmt.Sprintf(`ORDER BY %s`, strings.Join(f.sortExpressions, ", ")))
parts += fmt.Sprintf(" ORDER BY %s", strings.Join(f.sortExpressions, ", "))
}
if len(parts) > 0 {
parts = append(parts, ", lower(f.title) ASC")
parts += ", lower(f.title) ASC"
}
if f.limit > 0 {
parts = append(parts, fmt.Sprintf(`LIMIT %d`, f.limit))
parts += fmt.Sprintf(" LIMIT %d", f.limit)
}
if f.offset > 0 {
parts = append(parts, fmt.Sprintf(`OFFSET %d`, f.offset))
parts += fmt.Sprintf(" OFFSET %d", f.offset)
}
return strings.Join(parts, " ")
return parts
}
// GetFeed returns a single feed that match the condition.