1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-30 19:22:11 +00:00
miniflux-v2/internal/reader
Julien Voisin 5a97bf8b5e
refactor(sanitizer): simplify hasValidURIScheme and isBlockedResource functions
- 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)
```
2025-09-29 19:42:45 -07:00
..
atom refactor(misc): fix a handful of TODO 2025-08-09 15:22:02 -07:00
date perf: convert some slices to array 2025-09-08 12:11:18 -07:00
dublincore Refactor RDF parser to use an adapter 2024-03-12 20:54:05 -07:00
encoding fix(scraper): avoid encoding issue if charset meta tag is after 1024 bytes 2025-02-15 17:05:14 -08:00
fetcher refactor(fetcher): use time.Duration for client timeout values 2025-08-20 19:45:24 -07:00
filter refactor(config): rewrite config parser 2025-09-14 10:51:04 -07:00
googleplay Refactor RSS Parser to use an adapter 2024-03-13 21:25:09 -07:00
handler refactor(reader): use time.Duration instead of minutes count 2025-08-20 19:45:24 -07:00
icon fix(icon): implement better handling of relative icon URLs within a subfolder 2025-09-09 20:18:50 -07:00
itunes Refactor RSS Parser to use an adapter 2024-03-13 21:25:09 -07:00
json fix(jsonfeed): fallback to external_url when url is missing 2025-09-26 20:05:39 -07:00
media perf: convert some slices to array 2025-09-08 12:11:18 -07:00
opml refactor(opml): reduce indirections 2025-08-12 19:47:47 -07:00
parser refactor(parser): centralize seek logic and provide a hint for the compiler to eliminate a useless bound check 2025-08-03 12:53:10 -07:00
processor refactor(config): rewrite config parser 2025-09-14 10:51:04 -07:00
rdf refactor: unexport symbols 2025-08-07 17:27:04 -07:00
readability feat(readability): avoid removing elements with content class 2025-07-25 19:59:47 -07:00
readingtime refactor(tests): use b.Loop() instead of for range b.N 2025-06-18 20:12:55 -07:00
rewrite feat(rewrite): add add_image_title rule for explainxkcd.com 2025-09-25 17:32:22 -07:00
rss refactor(reader): use time.Duration instead of minutes count 2025-08-20 19:45:24 -07:00
sanitizer refactor(sanitizer): simplify hasValidURIScheme and isBlockedResource functions 2025-09-29 19:42:45 -07:00
scraper fix(scraper): update Dark Reading scraper rule 2025-09-23 19:52:17 -07:00
subscription refactor(subscription): combine findSubscriptionsFromYouTubeChannelPage and findSubscriptionsFromYouTubePlaylistPage functions 2025-09-12 17:59:41 -07:00
urlcleaner perf(reader): optimize RemoveTrackingParameters 2025-06-10 19:29:25 -07:00
xml perf(xml): eliminate bound checks in filterValidXMLChars 2025-09-08 15:33:55 -07:00