| 230 | |
| 231 | |
| 232 | int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) { |
| 233 | int res; |
| 234 | if (ttisnumber(l) && ttisnumber(r)) |
| 235 | return luai_numlt(L, nvalue(l), nvalue(r)); |
| 236 | else if (ttisstring(l) && ttisstring(r)) |
| 237 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; |
| 238 | else if ((res = call_orderTM(L, l, r, TM_LT)) < 0) |
| 239 | luaG_ordererror(L, l, r); |
| 240 | return res; |
| 241 | } |
| 242 | |
| 243 | |
| 244 | int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r) { |
no test coverage detected