MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaH_setint

Function luaH_setint

third-party/lua-5.5.0/src/ltable.c:1206–1218  ·  view source on GitHub ↗

** Ditto for a GC barrier. (No need to invalidate the TM cache, as ** integers cannot be keys to metamethods.) */

Source from the content-addressed store, hash-verified

1204** integers cannot be keys to metamethods.)
1205*/
1206void luaH_setint (lua_State *L, Table *t, lua_Integer key, TValue *value) {
1207 unsigned ik = ikeyinarray(t, key);
1208 if (ik > 0)
1209 obj2arr(t, ik - 1, value);
1210 else {
1211 int ok = rawfinishnodeset(getintfromhash(t, key), value);
1212 if (!ok) {
1213 TValue k;
1214 setivalue(&k, key);
1215 luaH_newkey(L, t, &k, value);
1216 }
1217 }
1218}
1219
1220
1221/*

Callers 5

init_registryFunction · 0.70
createvarargtabFunction · 0.70
loadStringFunction · 0.70
collectvalidlinesFunction · 0.70
lua_rawsetiFunction · 0.70

Calls 3

rawfinishnodesetFunction · 0.85
getintfromhashFunction · 0.85
luaH_newkeyFunction · 0.70

Tested by

no test coverage detected