MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / lua_seti

Function lua_seti

extlibs/lua/src/lapi.c:835–851  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

833
834
835LUA_API void lua_seti (lua_State *L, int idx, lua_Integer n) {
836 TValue *t;
837 const TValue *slot;
838 lua_lock(L);
839 api_checknelems(L, 1);
840 t = index2value(L, idx);
841 if (luaV_fastgeti(L, t, n, slot)) {
842 luaV_finishfastset(L, t, slot, s2v(L->top - 1));
843 }
844 else {
845 TValue aux;
846 setivalue(&aux, n);
847 luaV_finishset(L, t, &aux, s2v(L->top - 1), slot);
848 }
849 L->top--; /* pop value */
850 lua_unlock(L);
851}
852
853
854static void aux_rawset (lua_State *L, int idx, TValue *key, int n) {

Callers 5

tinsertFunction · 0.70
tremoveFunction · 0.70
tmoveFunction · 0.70
tpackFunction · 0.70
set2Function · 0.70

Calls 2

index2valueFunction · 0.85
luaV_finishsetFunction · 0.85

Tested by

no test coverage detected