MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / binsearch

Function binsearch

3rd/lua-5.4.3/src/ltable.c:869–877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

867
868
869static unsigned int binsearch (const TValue *array, unsigned int i,
870 unsigned int j) {
871 while (j - i > 1u) { /* binary search */
872 unsigned int m = (i + j) / 2;
873 if (isempty(&array[m - 1])) j = m;
874 else i = m;
875 }
876 return i;
877}
878
879
880/*

Callers 1

luaH_getnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected