| 811 | |
| 812 | |
| 813 | LUA_API void lua_settable (lua_State *L, int idx) { |
| 814 | TValue *t; |
| 815 | const TValue *slot; |
| 816 | lua_lock(L); |
| 817 | api_checknelems(L, 2); |
| 818 | t = index2value(L, idx); |
| 819 | if (luaV_fastget(L, t, s2v(L->top - 2), slot, luaH_get)) { |
| 820 | luaV_finishfastset(L, t, slot, s2v(L->top - 1)); |
| 821 | } |
| 822 | else |
| 823 | luaV_finishset(L, t, s2v(L->top - 2), s2v(L->top - 1), slot); |
| 824 | L->top -= 2; /* pop index and value */ |
| 825 | lua_unlock(L); |
| 826 | } |
| 827 | |
| 828 | |
| 829 | LUA_API void lua_setfield (lua_State *L, int idx, const char *k) { |
no test coverage detected