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:
parent
884521a7dd
commit
50c5996280
5 changed files with 30 additions and 28 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue