mirror of
https://github.com/miniflux/v2.git
synced 2025-09-30 19:22:11 +00:00
- use an array instead of a map for the schemes, as the overwhelming majority of them will be either http or https, which we can place in front of the array. This is faster than using a map. - Simplify hasValidURIScheme by using strings.HasPrefix instead of doing strings.IndexByte - Simplify isBlockedResource by using a simple for loop, instead of a weird slices.ContainsFunc+strings.Contains construct. On my noisy system: ``` goos: linux goarch: arm64 pkg: miniflux.app/v2/internal/reader/sanitizer │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ Sanitize-8 22.19m ± 4% 21.97m ± 4% ~ (p=0.948 n=50) ``` |
||
---|---|---|
.. | ||
testdata | ||
sanitizer.go | ||
sanitizer_test.go | ||
srcset.go | ||
srcset_test.go | ||
strip_tags.go | ||
strip_tags_test.go | ||
truncate.go | ||
truncate_test.go |