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

Function XOrdLookup

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

Source from the content-addressed store, hash-verified

123}
124
125S32 XOrdLookup(st_XORDEREDARRAY* array, const void* key, XOrdTestCallback test)
126{
127 S32 da_idx = -1;
128 S32 k0 = 0;
129 S32 k1 = 0;
130 S32 k = 0;
131 S32 v = 0;
132
133 k0 = 0;
134 k1 = array->cnt;
135 while (k1 > k0)
136 {
137 k = (k0 + k1) / 2;
138 v = test(key, array->list[k]);
139 if (v == 0)
140 {
141 da_idx = k;
142 break;
143 }
144 if (v > 0)
145 k0 = k + 1;
146 else
147 k1 = k;
148 }
149
150 return da_idx;
151}
152
153void XOrdSort(st_XORDEREDARRAY* array, XOrdCompareCallback test)
154{

Callers 13

XSER_get_clientFunction · 0.70
PKR_FindAssetFunction · 0.70
PKR_GetAssetSizeFunction · 0.70
PKR_IsAssetReadyFunction · 0.70
PKR_AssetNameFunction · 0.70
PKR_GetAssetInfoFunction · 0.70
PKR_PkgHasAssetFunction · 0.70
LOD_r_LHDRFunction · 0.70
RegItemTypeMethod · 0.70
CreateItemMethod · 0.70
DestroyItemMethod · 0.70

Calls 1

testFunction · 0.85

Tested by

no test coverage detected