MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / lua_seti

Function lua_seti

lib/lua/src/lapi.c:877–893  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 6

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

Calls 2

index2valueFunction · 0.85
luaV_finishsetFunction · 0.85

Tested by

no test coverage detected