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

Function luaV_lessthan

third-party/lua-5.3.5/src/lvm.c:364–373  ·  view source on GitHub ↗

** Main operation less than; return 'l < r'. */

Source from the content-addressed store, hash-verified

362** Main operation less than; return 'l < r'.
363*/
364int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) {
365 int res;
366 if (ttisnumber(l) && ttisnumber(r)) /* both operands are numbers? */
367 return LTnum(l, r);
368 else if (ttisstring(l) && ttisstring(r)) /* both are strings? */
369 return l_strcmp(tsvalue(l), tsvalue(r)) < 0;
370 else if ((res = luaT_callorderTM(L, l, r, TM_LT)) < 0) /* no metamethod? */
371 luaG_ordererror(L, l, r); /* error */
372 return res;
373}
374
375
376/*

Callers 2

luaV_executeFunction · 0.70
lua_compareFunction · 0.70

Calls 4

LTnumFunction · 0.70
l_strcmpFunction · 0.70
luaT_callorderTMFunction · 0.70
luaG_ordererrorFunction · 0.70

Tested by

no test coverage detected