MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / lessequal

Function lessequal

Source/Misc/lua/src/lua.c:15068–15081  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15066
15067
15068static int lessequal (lua_State *L, const TValue *l, const TValue *r) {
15069int res;
15070if (ttype(l) != ttype(r))
15071return luaG_ordererror(L, l, r);
15072else if (ttisnumber(l))
15073return luai_numle(nvalue(l), nvalue(r));
15074else if (ttisstring(l))
15075return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0;
15076else if ((res = call_orderTM(L, l, r, TM_LE)) != -1) /* first try `le' */
15077return res;
15078else if ((res = call_orderTM(L, r, l, TM_LT)) != -1) /* else try `lt' */
15079return !res;
15080return luaG_ordererror(L, l, r);
15081}
15082
15083
15084int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2) {

Callers 1

luaV_executeFunction · 0.85

Calls 3

luaG_ordererrorFunction · 0.85
l_strcmpFunction · 0.85
call_orderTMFunction · 0.85

Tested by

no test coverage detected