MCPcopy Create free account
hub / github.com/defold/defold / lessequal

Function lessequal

engine/lua/src/lua/lvm.c:235–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233
234
235static int lessequal (lua_State *L, const TValue *l, const TValue *r) {
236 int res;
237 if (ttype(l) != ttype(r))
238 return luaG_ordererror(L, l, r);
239 else if (ttisnumber(l))
240 return luai_numle(nvalue(l), nvalue(r));
241 else if (ttisstring(l))
242 return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0;
243 else if ((res = call_orderTM(L, l, r, TM_LE)) != -1) /* first try `le' */
244 return res;
245 else if ((res = call_orderTM(L, r, l, TM_LT)) != -1) /* else try `lt' */
246 return !res;
247 return luaG_ordererror(L, l, r);
248}
249
250
251int 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