MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaV_lessthan

Function luaV_lessthan

depends/lua/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.85
lua_compareFunction · 0.85

Calls 4

LTnumFunction · 0.85
l_strcmpFunction · 0.85
luaT_callorderTMFunction · 0.85
luaG_ordererrorFunction · 0.85

Tested by

no test coverage detected