| 241 | |
| 242 | |
| 243 | int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r) { |
| 244 | int res; |
| 245 | if (ttisnumber(l) && ttisnumber(r)) |
| 246 | return luai_numle(L, nvalue(l), nvalue(r)); |
| 247 | else if (ttisstring(l) && ttisstring(r)) |
| 248 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; |
| 249 | else if ((res = call_orderTM(L, l, r, TM_LE)) >= 0) /* first try `le' */ |
| 250 | return res; |
| 251 | else if ((res = call_orderTM(L, r, l, TM_LT)) < 0) /* else try `lt' */ |
| 252 | luaG_ordererror(L, l, r); |
| 253 | return !res; |
| 254 | } |
| 255 | |
| 256 | |
| 257 | /* |
no test coverage detected