MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / lua_compare

Function lua_compare

third-party/lua-5.2.4/src/lapi.c:316–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

sort_compFunction · 0.70

Calls 3

index2addrFunction · 0.70
luaV_lessthanFunction · 0.70
luaV_lessequalFunction · 0.70

Tested by

no test coverage detected