| 853 | |
| 854 | |
| 855 | LUA_API void lua_settable (lua_State *L, int idx) { |
| 856 | TValue *t; |
| 857 | const TValue *slot; |
| 858 | lua_lock(L); |
| 859 | api_checknelems(L, 2); |
| 860 | t = index2value(L, idx); |
| 861 | if (luaV_fastget(L, t, s2v(L->top.p - 2), slot, luaH_get)) { |
| 862 | luaV_finishfastset(L, t, slot, s2v(L->top.p - 1)); |
| 863 | } |
| 864 | else |
| 865 | luaV_finishset(L, t, s2v(L->top.p - 2), s2v(L->top.p - 1), slot); |
| 866 | L->top.p -= 2; /* pop index and value */ |
| 867 | lua_unlock(L); |
| 868 | } |
| 869 | |
| 870 | |
| 871 | LUA_API void lua_setfield (lua_State *L, int idx, const char *k) { |