MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / lua_seti

Function lua_seti

3rd/lua-5.4.3/src/lapi.c:871–887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

869
870
871LUA_API void lua_seti (lua_State *L, int idx, lua_Integer n) {
872 TValue *t;
873 const TValue *slot;
874 lua_lock(L);
875 api_checknelems(L, 1);
876 t = index2value(L, idx);
877 if (luaV_fastgeti(L, t, n, slot)) {
878 luaV_finishfastset(L, t, slot, s2v(L->top - 1));
879 }
880 else {
881 TValue aux;
882 setivalue(&aux, n);
883 luaV_finishset(L, t, &aux, s2v(L->top - 1), slot);
884 }
885 L->top--; /* pop value */
886 lua_unlock(L);
887}
888
889
890static 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