1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

fixed a typo pointed out by Igor try to speed up node compare using line

* globals.c: fixed a typo pointed out by Igor
* xpath.c: try to speed up node compare using line numbers
  if available.
Daniel
This commit is contained in:
Daniel Veillard
2002-11-08 15:10:00 +00:00
parent a70d62f296
commit 7216cfd662
30 changed files with 49 additions and 28 deletions

15
xpath.c
View File

@ -1367,6 +1367,21 @@ xmlXPathCmpNodes(xmlNodePtr node1, xmlNodePtr node2) {
if (node1 == node2->next)
return(-1);
/*
* Speedup using line numbers if availble.
*/
if ((node1->type == XML_ELEMENT_NODE) &&
(node2->type == XML_ELEMENT_NODE) &&
(0 != (int) node1->content) && (0 != (int) node2->content)) {
int l1, l2;
l1 = (int) node1->content;
l2 = (int) node2->content;
if (l1 < l2)
return(1);
if (l1 > l2)
return(-1);
}
/*
* compute depth to root
*/