| 781 | |
| 782 | |
| 783 | LUA_API void lua_seti (lua_State *L, int idx, lua_Integer n) { |
| 784 | StkId t; |
| 785 | const TValue *slot; |
| 786 | lua_lock(L); |
| 787 | api_checknelems(L, 1); |
| 788 | t = index2addr(L, idx); |
| 789 | if (luaV_fastset(L, t, n, slot, luaH_getint, L->top - 1)) |
| 790 | L->top--; /* pop value */ |
| 791 | else { |
| 792 | setivalue(L->top, n); |
| 793 | api_incr_top(L); |
| 794 | luaV_finishset(L, t, L->top - 1, L->top - 2, slot); |
| 795 | L->top -= 2; /* pop value and key */ |
| 796 | } |
| 797 | lua_unlock(L); |
| 798 | } |
| 799 | |
| 800 | |
| 801 | LUA_API void lua_rawset (lua_State *L, int idx) { |