libdom: branch master updated. release/0.0.1-3-gdb1fd54

NetSurf Browser Project (Commit Mailer) no-reply at netsurf-browser.org
Thu May 23 16:17:01 BST 2013


Gitweb links:

...log http://git.netsurf-browser.org/libdom.git/shortlog/db1fd54ff3a1441a28360b48a020b42f6af7793b
...commit http://git.netsurf-browser.org/libdom.git/commit/db1fd54ff3a1441a28360b48a020b42f6af7793b
...tree http://git.netsurf-browser.org/libdom.git/tree/db1fd54ff3a1441a28360b48a020b42f6af7793b

The branch, master has been updated
       via  db1fd54ff3a1441a28360b48a020b42f6af7793b (commit)
      from  33d59e121f9f919f3fcb81dcc3225caca164f99b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libdom.git/commit/?id=db1fd54ff3a1441a28360b48a020b42f6af7793b
commit db1fd54ff3a1441a28360b48a020b42f6af7793b
Author: Michael Drake <tlsa at netsurf-browser.org>
Commit: Michael Drake <tlsa at netsurf-browser.org>

    Compare the name and prefix directly.  Since this avoids string concatination, and (un)ref.

diff --git a/src/core/node.c b/src/core/node.c
index a09bf97..a59cc01 100644
--- a/src/core/node.c
+++ b/src/core/node.c
@@ -1595,7 +1595,6 @@ dom_exception _dom_node_is_equal(dom_node_internal *node,
 		dom_node_internal *other, bool *result)
 {
 	dom_exception err = DOM_NO_ERR;
-	dom_string *s1 = NULL, *s2 = NULL;
 	dom_namednodemap *m1 = NULL, *m2 = NULL;
 	dom_nodelist *l1 = NULL, *l2 = NULL;
 	*result = false;
@@ -1610,20 +1609,14 @@ dom_exception _dom_node_is_equal(dom_node_internal *node,
 	assert(node->owner != NULL);
 	assert(other->owner != NULL);
 
-	/* Compare the node names (and prefix) */
-	err = dom_node_get_node_name(node, &s1);
-	if (err != DOM_NO_ERR) {
-		/* error */
-		goto cleanup;
-	}
-
-	err = dom_node_get_node_name(other, &s2);
-	if (err != DOM_NO_ERR) {
-		/* error */
+	/* Compare node name */
+	if (dom_string_isequal(node->name, other->name) == false) {
+		/* different */
 		goto cleanup;
 	}
 
-	if (dom_string_isequal(s1, s2) == false) {
+	/* Compare prefix */
+	if (dom_string_isequal(node->prefix, other->prefix) == false) {
 		/* different */
 		goto cleanup;
 	}
@@ -1679,11 +1672,6 @@ dom_exception _dom_node_is_equal(dom_node_internal *node,
 	*result = true;
 
 cleanup:
-	if (s1 != NULL)
-		dom_string_unref(s1);
-	if (s2 != NULL)
-		dom_string_unref(s2);
-
 	if (m1 != NULL)
 		dom_namednodemap_unref(m1);
 	if (m2 != NULL)


-----------------------------------------------------------------------

Summary of changes:
 src/core/node.c |   22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/src/core/node.c b/src/core/node.c
index a09bf97..a59cc01 100644
--- a/src/core/node.c
+++ b/src/core/node.c
@@ -1595,7 +1595,6 @@ dom_exception _dom_node_is_equal(dom_node_internal *node,
 		dom_node_internal *other, bool *result)
 {
 	dom_exception err = DOM_NO_ERR;
-	dom_string *s1 = NULL, *s2 = NULL;
 	dom_namednodemap *m1 = NULL, *m2 = NULL;
 	dom_nodelist *l1 = NULL, *l2 = NULL;
 	*result = false;
@@ -1610,20 +1609,14 @@ dom_exception _dom_node_is_equal(dom_node_internal *node,
 	assert(node->owner != NULL);
 	assert(other->owner != NULL);
 
-	/* Compare the node names (and prefix) */
-	err = dom_node_get_node_name(node, &s1);
-	if (err != DOM_NO_ERR) {
-		/* error */
-		goto cleanup;
-	}
-
-	err = dom_node_get_node_name(other, &s2);
-	if (err != DOM_NO_ERR) {
-		/* error */
+	/* Compare node name */
+	if (dom_string_isequal(node->name, other->name) == false) {
+		/* different */
 		goto cleanup;
 	}
 
-	if (dom_string_isequal(s1, s2) == false) {
+	/* Compare prefix */
+	if (dom_string_isequal(node->prefix, other->prefix) == false) {
 		/* different */
 		goto cleanup;
 	}
@@ -1679,11 +1672,6 @@ dom_exception _dom_node_is_equal(dom_node_internal *node,
 	*result = true;
 
 cleanup:
-	if (s1 != NULL)
-		dom_string_unref(s1);
-	if (s2 != NULL)
-		dom_string_unref(s2);
-
 	if (m1 != NULL)
 		dom_namednodemap_unref(m1);
 	if (m2 != NULL)


-- 
Document Object Model library



More information about the netsurf-commits mailing list