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

Function lua_seti

xrepo/packages/l/lua/port/lua/src/lapi.c:881–897  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

879
880
881LUA_API void lua_seti (lua_State *L, int idx, lua_Integer n) {
882 TValue *t;
883 const TValue *slot;
884 lua_lock(L);
885 api_checknelems(L, 1);
886 t = index2value(L, idx);
887 if (luaV_fastgeti(L, t, n, slot)) {
888 luaV_finishfastset(L, t, slot, s2v(L->top - 1));
889 }
890 else {
891 TValue aux;
892 setivalue(&aux, n);
893 luaV_finishset(L, t, &aux, s2v(L->top - 1), slot);
894 }
895 L->top--; /* pop value */
896 lua_unlock(L);
897}
898
899
900static void aux_rawset (lua_State *L, int idx, TValue *key, int n) {

Callers 5

tinsertFunction · 0.85
tremoveFunction · 0.85
tmoveFunction · 0.85
tpackFunction · 0.85
set2Function · 0.85

Calls 2

index2valueFunction · 0.85
luaV_finishsetFunction · 0.85

Tested by

no test coverage detected