| 693 | |
| 694 | |
| 695 | LUA_API int lua_geti (lua_State *L, int idx, lua_Integer n) { |
| 696 | TValue *t; |
| 697 | const TValue *slot; |
| 698 | lua_lock(L); |
| 699 | t = index2value(L, idx); |
| 700 | if (luaV_fastgeti(L, t, n, slot)) { |
| 701 | setobj2s(L, L->top.p, slot); |
| 702 | } |
| 703 | else { |
| 704 | TValue aux; |
| 705 | setivalue(&aux, n); |
| 706 | luaV_finishget(L, t, &aux, L->top.p, slot); |
| 707 | } |
| 708 | api_incr_top(L); |
| 709 | lua_unlock(L); |
| 710 | return ttype(s2v(L->top.p - 1)); |
| 711 | } |
| 712 | |
| 713 | |
| 714 | l_sinline int finishrawget (lua_State *L, const TValue *val) { |