MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlListSort

Function xmlListSort

ThirdParty/libxml2/vtklibxml2/list.c:625–647  ·  view source on GitHub ↗

* xmlListSort: * @l: a list * * Sort all the elements in the list */

Source from the content-addressed store, hash-verified

623 * Sort all the elements in the list
624 */
625void
626xmlListSort(xmlListPtr l)
627{
628 xmlListPtr lTemp;
629
630 if (l == NULL)
631 return;
632 if(xmlListEmpty(l))
633 return;
634
635 /* I think that the real answer is to implement quicksort, the
636 * alternative is to implement some list copying procedure which
637 * would be based on a list copy followed by a clear followed by
638 * an insert. This is slow...
639 */
640
641 if (NULL ==(lTemp = xmlListDup(l)))
642 return;
643 xmlListClear(l);
644 xmlListMerge(l, lTemp);
645 xmlListDelete(lTemp);
646 return;
647}
648
649/**
650 * xmlListWalk:

Callers

nothing calls this directly

Calls 5

xmlListEmptyFunction · 0.85
xmlListDupFunction · 0.85
xmlListClearFunction · 0.85
xmlListMergeFunction · 0.85
xmlListDeleteFunction · 0.85

Tested by

no test coverage detected