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

Function lua_gettable

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

Source from the content-addressed store, hash-verified

666
667
668LUA_API int lua_gettable (lua_State *L, int idx) {
669 const TValue *slot;
670 TValue *t;
671 lua_lock(L);
672 t = index2value(L, idx);
673 if (luaV_fastget(L, t, s2v(L->top - 1), slot, luaH_get)) {
674 setobj2s(L, L->top - 1, slot);
675 }
676 else
677 luaV_finishget(L, t, s2v(L->top - 1), L->top - 1, slot);
678 lua_unlock(L);
679 return ttype(s2v(L->top - 1));
680}
681
682
683LUA_API int lua_getfield (lua_State *L, int idx, const char *k) {

Callers 1

add_valueFunction · 0.85

Calls 2

index2valueFunction · 0.85
luaV_finishgetFunction · 0.85

Tested by

no test coverage detected