summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-07-07 19:48:41 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-07-07 19:48:41 +0100
commit50d83f430d109472dee45910851275fe189b0fdb (patch)
tree55225422867df02f1d2e1cf86b38c79f5aaab8cc /src
parenteff7f871fd14038b60b183962d040c9a135dcde6 (diff)
downloadlibdom-50d83f430d109472dee45910851275fe189b0fdb.tar.gz
libdom-50d83f430d109472dee45910851275fe189b0fdb.tar.bz2
HTMLDocument: Tidy implementation of is_form predicate
Diffstat (limited to 'src')
-rw-r--r--src/html/html_document.c17
1 files changed, 3 insertions, 14 deletions
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,