MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lua_compare

Function lua_compare

freebsd/contrib/openzfs/module/lua/lapi.c:313–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

sort_compFunction · 0.85

Calls 3

index2addrFunction · 0.85
luaV_lessequalFunction · 0.85
luaV_lessthanFunction · 0.70

Tested by

no test coverage detected