mirror of
https://github.com/miniflux/v2.git
synced 2025-08-16 18:01:37 +00:00
perf(misc): use arrays instead of slices where possible
Arrays have a fixed size in go, while slices don't, making the former way faster than the latter: https://go-benchmarks.com/array-vs-slice
This commit is contained in:
parent
68984da332
commit
3a01f8a691
5 changed files with 7 additions and 7 deletions
|
@ -107,7 +107,7 @@ func addDynamicImage(entryContent string) string {
|
|||
doc := goquery.NewDocumentFromNode(parserHtml)
|
||||
|
||||
// Ordered most preferred to least preferred.
|
||||
candidateAttrs := []string{
|
||||
candidateAttrs := [...]string{
|
||||
"data-src",
|
||||
"data-original",
|
||||
"data-orig",
|
||||
|
@ -124,7 +124,7 @@ func addDynamicImage(entryContent string) string {
|
|||
"data-380src",
|
||||
}
|
||||
|
||||
candidateSrcsetAttrs := []string{
|
||||
candidateSrcsetAttrs := [...]string{
|
||||
"data-srcset",
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue