** Main operation less than; return 'l < r'. */
| 362 | ** Main operation less than; return 'l < r'. |
| 363 | */ |
| 364 | int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) { |
| 365 | int res; |
| 366 | if (ttisnumber(l) && ttisnumber(r)) /* both operands are numbers? */ |
| 367 | return LTnum(l, r); |
| 368 | else if (ttisstring(l) && ttisstring(r)) /* both are strings? */ |
| 369 | return l_strcmp(tsvalue(l), tsvalue(r)) < 0; |
| 370 | else if ((res = luaT_callorderTM(L, l, r, TM_LT)) < 0) /* no metamethod? */ |
| 371 | luaG_ordererror(L, l, r); /* error */ |
| 372 | return res; |
| 373 | } |
| 374 | |
| 375 | |
| 376 | /* |
no test coverage detected