| 652 | |
| 653 | |
| 654 | LUA_API int lua_geti (lua_State *L, int idx, lua_Integer n) { |
| 655 | TValue *t; |
| 656 | const TValue *slot; |
| 657 | lua_lock(L); |
| 658 | t = index2value(L, idx); |
| 659 | if (luaV_fastgeti(L, t, n, slot)) { |
| 660 | setobj2s(L, L->top, slot); |
| 661 | } |
| 662 | else { |
| 663 | TValue aux; |
| 664 | setivalue(&aux, n); |
| 665 | luaV_finishget(L, t, &aux, L->top, slot); |
| 666 | } |
| 667 | api_incr_top(L); |
| 668 | lua_unlock(L); |
| 669 | return ttype(s2v(L->top - 1)); |
| 670 | } |
| 671 | |
| 672 | |
| 673 | static int finishrawget (lua_State *L, const TValue *val) { |