| 626 | |
| 627 | |
| 628 | LUA_API int lua_geti (lua_State *L, int idx, lua_Integer n) { |
| 629 | StkId t; |
| 630 | const TValue *slot; |
| 631 | lua_lock(L); |
| 632 | t = index2addr(L, idx); |
| 633 | if (luaV_fastget(L, t, n, slot, luaH_getint)) { |
| 634 | setobj2s(L, L->top, slot); |
| 635 | api_incr_top(L); |
| 636 | } |
| 637 | else { |
| 638 | setivalue(L->top, n); |
| 639 | api_incr_top(L); |
| 640 | luaV_finishget(L, t, L->top - 1, L->top - 1, slot); |
| 641 | } |
| 642 | lua_unlock(L); |
| 643 | return ttnov(L->top - 1); |
| 644 | } |
| 645 | |
| 646 | |
| 647 | LUA_API int lua_rawget (lua_State *L, int idx) { |