| 687 | |
| 688 | |
| 689 | LUA_API int lua_geti (lua_State *L, int idx, lua_Integer n) { |
| 690 | TValue *t; |
| 691 | const TValue *slot; |
| 692 | lua_lock(L); |
| 693 | t = index2value(L, idx); |
| 694 | if (luaV_fastgeti(L, t, n, slot)) { |
| 695 | setobj2s(L, L->top, slot); |
| 696 | } |
| 697 | else { |
| 698 | TValue aux; |
| 699 | setivalue(&aux, n); |
| 700 | luaV_finishget(L, t, &aux, L->top, slot); |
| 701 | } |
| 702 | api_incr_top(L); |
| 703 | lua_unlock(L); |
| 704 | return ttype(s2v(L->top - 1)); |
| 705 | } |
| 706 | |
| 707 | |
| 708 | static int finishrawget (lua_State *L, const TValue *val) { |