| 219 | |
| 220 | |
| 221 | int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) { |
| 222 | int res; |
| 223 | if (ttype(l) != ttype(r)) |
| 224 | return luaG_ordererror(L, l, r); |
| 225 | else if (ttisnumber(l)) |
| 226 | return luai_numlt(nvalue(l), nvalue(r)); |
| 227 | else if (ttisstring(l)) |
| 228 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; |
| 229 | else if ((res = call_orderTM(L, l, r, TM_LT)) != -1) |
| 230 | return res; |
| 231 | return luaG_ordererror(L, l, r); |
| 232 | } |
| 233 | |
| 234 | |
| 235 | static int lessequal (lua_State *L, const TValue *l, const TValue *r) { |
no test coverage detected