MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / XOrdSort

Function XOrdSort

src/SB/Core/x/xordarray.cpp:153–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153void XOrdSort(st_XORDEREDARRAY* array, XOrdCompareCallback test)
154{
155 void** list = array->list;
156 S32 num = array->cnt;
157 S32 i = 0;
158 S32 j = 0;
159 S32 h = 1;
160 void* v = NULL;
161
162 while (h <= num)
163 h = h * 3 + 1;
164 while (h != 1)
165 {
166 h /= 3;
167 for (i = h; i < num; i++)
168 {
169 v = list[i];
170 for (j = i; j >= h && test(v, list[j - h]) < 0; j -= h)
171 {
172 list[j] = list[j - h];
173 }
174 list[j] = v;
175 }
176 }
177}

Callers 3

xSER_init_buffersFunction · 0.70
LOD_r_DICTFunction · 0.70
CreateNPCMethod · 0.50

Calls 1

testFunction · 0.85

Tested by

no test coverage detected