MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / sort

Function sort

include/Array.h:897–910  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

895 }
896
897 void sort(SorterFunc inSorter)
898 {
899 if ( (int)hx::ArrayTraits<ELEM_>::StoreType==(int)hx::arrayObject ||
900 (int)hx::ArrayTraits<ELEM_>::StoreType==(int)hx::arrayString)
901 {
902 // Keep references from being hidden inside sorters buffers
903 safeSort(inSorter, (int)hx::ArrayTraits<ELEM_>::StoreType==(int)hx::arrayString);
904 }
905 else
906 {
907 ELEM_ *e = (ELEM_ *)mBase;
908 std::stable_sort(e, e+length, Sorter(inSorter) );
909 }
910 }
911
912 Dynamic iterator() { return new hx::ArrayIterator<ELEM_,ELEM_>(this); }
913 Dynamic keyValueIterator() { return new hx::ArrayKeyValueIterator<ELEM_,ELEM_>(this); }

Callers 7

sortAscendingFunction · 0.70
sortDescendingFunction · 0.70
qsortFunction · 0.70
__sortFunction · 0.70
DumpStatsMethod · 0.50
MoveBlockJobMethod · 0.50
createFreeListMethod · 0.50

Calls 2

safeSortFunction · 0.85
SorterClass · 0.85

Tested by

no test coverage detected