* xmlListSort: * @l: a list * * Sort all the elements in the list */
| 623 | * Sort all the elements in the list |
| 624 | */ |
| 625 | void |
| 626 | xmlListSort(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: |
nothing calls this directly
no test coverage detected