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

Function lua_geti

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

Source from the content-addressed store, hash-verified

687
688
689LUA_API int lua_geti (lua_State *L, int idx, lua_Integer n) {
690 TValue *t;
691 const TValue *slot;
692 lua_lock(L);
693 t = index2value(L, idx);
694 if (luaV_fastgeti(L, t, n, slot)) {
695 setobj2s(L, L->top, slot);
696 }
697 else {
698 TValue aux;
699 setivalue(&aux, n);
700 luaV_finishget(L, t, &aux, L->top, slot);
701 }
702 api_incr_top(L);
703 lua_unlock(L);
704 return ttype(s2v(L->top - 1));
705}
706
707
708static int finishrawget (lua_State *L, const TValue *val) {

Callers 8

ipairsauxFunction · 0.70
tinsertFunction · 0.70
tremoveFunction · 0.70
tmoveFunction · 0.70
addfieldFunction · 0.70
tunpackFunction · 0.70
partitionFunction · 0.70
auxsortFunction · 0.70

Calls 2

index2valueFunction · 0.85
luaV_finishgetFunction · 0.85

Tested by

no test coverage detected