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