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

Function lessequal

app/redis-6.2.6/deps/lua/src/lvm.c:239–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237
238
239static int lessequal (lua_State *L, const TValue *l, const TValue *r) {
240 int res;
241 if (ttype(l) != ttype(r))
242 return luaG_ordererror(L, l, r);
243 else if (ttisnumber(l))
244 return luai_numle(nvalue(l), nvalue(r));
245 else if (ttisstring(l))
246 return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0;
247 else if ((res = call_orderTM(L, l, r, TM_LE)) != -1) /* first try `le' */
248 return res;
249 else if ((res = call_orderTM(L, r, l, TM_LT)) != -1) /* else try `lt' */
250 return !res;
251 return luaG_ordererror(L, l, r);
252}
253
254
255int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2) {

Callers 1

luaV_executeFunction · 0.85

Calls 3

luaG_ordererrorFunction · 0.70
l_strcmpFunction · 0.70
call_orderTMFunction · 0.70

Tested by

no test coverage detected