MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / lua_compare

Function lua_compare

ThirdParty/lua/lua/lapi.c:317–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315
316
317LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) {
318 StkId o1, o2;
319 int i = 0;
320 lua_lock(L); /* may call tag method */
321 o1 = index2addr(L, index1);
322 o2 = index2addr(L, index2);
323 if (isvalid(o1) && isvalid(o2)) {
324 switch (op) {
325 case LUA_OPEQ: i = luaV_equalobj(L, o1, o2); break;
326 case LUA_OPLT: i = luaV_lessthan(L, o1, o2); break;
327 case LUA_OPLE: i = luaV_lessequal(L, o1, o2); break;
328 default: api_check(0, "invalid option");
329 }
330 }
331 lua_unlock(L);
332 return i;
333}
334
335
336LUA_API size_t lua_stringtonumber (lua_State *L, const char *s) {

Callers 3

math_minFunction · 0.85
math_maxFunction · 0.85
sort_compFunction · 0.85

Calls 4

index2addrFunction · 0.85
luaV_equalobjFunction · 0.85
luaV_lessthanFunction · 0.85
luaV_lessequalFunction · 0.85

Tested by

no test coverage detected