From 50f4b46616980a49d05cb0206e2aac3255d26bbd Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Tue, 27 Sep 2005 14:39:40 +0200 Subject: [PATCH] dom_node_cmp(): Minor optimization --- src/document/dom/node.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/document/dom/node.c b/src/document/dom/node.c index 37fbeb2c5..1f676fcd0 100644 --- a/src/document/dom/node.c +++ b/src/document/dom/node.c @@ -134,12 +134,11 @@ dom_node_cmp(struct dom_node_search *search, struct dom_node *node) { int length = int_min(key->length, node->length); int string_diff = strncasecmp(key->string, node->string, length); - int length_diff = key->length - node->length; /* If the lengths or strings don't match strncasecmp() does the * job else return which ever is bigger. */ - return string_diff ? string_diff : length_diff; + return string_diff ? string_diff : key->length - node->length; } }