mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
dom_node_cmp(): Minor optimization
This commit is contained in:
parent
d8bc3f7b15
commit
50f4b46616
@ -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 length = int_min(key->length, node->length);
|
||||||
int string_diff = strncasecmp(key->string, node->string, 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
|
/* If the lengths or strings don't match strncasecmp() does the
|
||||||
* job else return which ever is bigger. */
|
* job else return which ever is bigger. */
|
||||||
|
|
||||||
return string_diff ? string_diff : length_diff;
|
return string_diff ? string_diff : key->length - node->length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user