diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-04-28 20:02:14 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-04-28 20:02:14 +0200 |
commit | 4694f8544c4cbd7e7d92323976b63cc77fdadb27 (patch) | |
tree | a1d45799ee92e8513715b5b7a95908e961795c10 /src/plugins/Spankbang.cpp | |
parent | 3b0d367c6b70f88e5fa01a1813f9487c37401050 (diff) |
Lazy load recommendations, simplify html parser
Diffstat (limited to 'src/plugins/Spankbang.cpp')
-rw-r--r-- | src/plugins/Spankbang.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/plugins/Spankbang.cpp b/src/plugins/Spankbang.cpp index cc35d39..ac0e371 100644 --- a/src/plugins/Spankbang.cpp +++ b/src/plugins/Spankbang.cpp @@ -21,10 +21,6 @@ namespace { } namespace QuickMedia { - static bool begins_with(const char *str, const char *begin_with) { - return strncmp(str, begin_with, strlen(begin_with)) == 0; - } - static void html_cleanup(HtmlElement *html_element_root) { for(HtmlElement *child_html_element : html_element_root->children) { html_cleanup(child_html_element); @@ -59,14 +55,11 @@ namespace QuickMedia { } } - static HtmlElement* html_parse(char *source, size_t size) { + static HtmlElement* html_parse(const char *source, size_t size) { HtmlElement *html_element_root = new HtmlElement(); HtmlParseUserdata parse_userdata; parse_userdata.current_html_element = html_element_root; - HtmlParser html_parser; - html_parser_init(&html_parser, source, size, html_page_callback, &parse_userdata); - html_parser_parse(&html_parser); - html_parser_deinit(&html_parser); + html_parser_parse(source, size, html_page_callback, &parse_userdata); return html_element_root; } |