From 50d83f430d109472dee45910851275fe189b0fdb Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 7 Jul 2012 19:48:41 +0100 Subject: HTMLDocument: Tidy implementation of is_form predicate --- src/html/html_document.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'src/html') diff --git a/src/html/html_document.c b/src/html/html_document.c index b266844..b36ca7d 100644 --- a/src/html/html_document.c +++ b/src/html/html_document.c @@ -428,21 +428,10 @@ dom_exception _dom_html_document_get_links(dom_html_document *doc, static bool __dom_html_document_node_is_form(dom_node_internal *node) { - dom_string *form; - dom_exception err; - - err = dom_string_create_interned((const uint8_t *) "form", - SLEN("form"), &form); - if (err == DOM_NO_ERR) { - if (dom_string_caseless_isequal(node->name, form)) { - dom_string_unref(form); - return true; - } - - dom_string_unref(form); - } + dom_html_document *doc = (dom_html_document *)node->owner; - return false; + return dom_string_caseless_isequal(node->name, + doc->memoised[hds_FORM]); } dom_exception _dom_html_document_get_forms(dom_html_document *doc, -- cgit v1.2.3