mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +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:
parent
863a5b3648
commit
e2ee74428a
3 changed files with 14 additions and 16 deletions
|
@ -439,21 +439,21 @@ func (e *EntryQueryBuilder) buildCondition() string {
|
|||
}
|
||||
|
||||
func (e *EntryQueryBuilder) buildSorting() string {
|
||||
var parts []string
|
||||
var parts string
|
||||
|
||||
if len(e.sortExpressions) > 0 {
|
||||
parts = append(parts, fmt.Sprintf(`ORDER BY %s`, strings.Join(e.sortExpressions, ", ")))
|
||||
parts += fmt.Sprintf(" ORDER BY %s", strings.Join(e.sortExpressions, ", "))
|
||||
}
|
||||
|
||||
if e.limit > 0 {
|
||||
parts = append(parts, fmt.Sprintf(`LIMIT %d`, e.limit))
|
||||
parts += fmt.Sprintf(" LIMIT %d", e.limit)
|
||||
}
|
||||
|
||||
if e.offset > 0 {
|
||||
parts = append(parts, fmt.Sprintf(`OFFSET %d`, e.offset))
|
||||
parts += fmt.Sprintf(" OFFSET %d", e.offset)
|
||||
}
|
||||
|
||||
return strings.Join(parts, " ")
|
||||
return parts
|
||||
}
|
||||
|
||||
// NewEntryQueryBuilder returns a new EntryQueryBuilder.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue