| 15066 | |
| 15067 | |
| 15068 | static int lessequal (lua_State *L, const TValue *l, const TValue *r) { |
| 15069 | int res; |
| 15070 | if (ttype(l) != ttype(r)) |
| 15071 | return luaG_ordererror(L, l, r); |
| 15072 | else if (ttisnumber(l)) |
| 15073 | return luai_numle(nvalue(l), nvalue(r)); |
| 15074 | else if (ttisstring(l)) |
| 15075 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; |
| 15076 | else if ((res = call_orderTM(L, l, r, TM_LE)) != -1) /* first try `le' */ |
| 15077 | return res; |
| 15078 | else if ((res = call_orderTM(L, r, l, TM_LT)) != -1) /* else try `lt' */ |
| 15079 | return !res; |
| 15080 | return luaG_ordererror(L, l, r); |
| 15081 | } |
| 15082 | |
| 15083 | |
| 15084 | int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2) { |
no test coverage detected