1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-16 18:01:37 +00:00

refactor: remove some fmt.Sprintf calls

fmt.Sprintf is slow, so let's get rid of it in trivial cases that are in (at
least) moderately hot paths.
This commit is contained in:
jvoisin 2025-08-08 22:55:35 +02:00 committed by Frédéric Guillot
parent 884521a7dd
commit 50c5996280
5 changed files with 30 additions and 28 deletions

View file

@ -5,7 +5,6 @@ package model // import "miniflux.app/v2/internal/model"
import (
"encoding/base64"
"fmt"
)
// Icon represents a website icon (favicon)
@ -19,7 +18,7 @@ type Icon struct {
// DataURL returns the data URL of the icon.
func (i *Icon) DataURL() string {
return fmt.Sprintf("%s;base64,%s", i.MimeType, base64.StdEncoding.EncodeToString(i.Content))
return i.MimeType + ";base64," + base64.StdEncoding.EncodeToString(i.Content)
}
// Icons represents a list of icons.