MCPcopy Create free account
hub / github.com/DFHack/dfhack / lua_seti

Function lua_seti

depends/lua/src/lapi.c:783–798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

781
782
783LUA_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
801LUA_API void lua_rawset (lua_State *L, int idx) {

Callers 5

tinsertFunction · 0.85
tremoveFunction · 0.85
tmoveFunction · 0.85
packFunction · 0.85
set2Function · 0.85

Calls 2

index2addrFunction · 0.85
luaV_finishsetFunction · 0.85

Tested by

no test coverage detected