Performance: A change in the merge code made "co-located" config and non-config get retrieval go considerable faster.

This commit is contained in:
Olof hagsand 2023-05-29 10:47:00 +02:00
parent 3e34a61bd2
commit a97a66cb92
3 changed files with 8 additions and 3 deletions

View file

@ -972,6 +972,7 @@ xml_child_order(cxobj *xp,
* xprev = x;
* }
* @endcode
* @note Assumes attributes are first in list
* @see xml_child_index_each
*/
cxobj *
@ -990,8 +991,11 @@ xml_child_each(cxobj *xparent,
xn = xparent->x_childvec[i];
if (xn == NULL)
continue;
if (type != CX_ERROR && xml_type(xn) != type)
if (type != CX_ERROR && xml_type(xn) != type){
if (type == CX_ATTR) /* Assume sorted attributes are first */
return NULL;
continue;
}
break; /* this is next object after previous */
}
if (i < xparent->x_childvec_len) /* found */