MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaL_traverse_table

Function luaL_traverse_table

src/Chain/libraries/glua/lapi.cpp:1429–1448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1427}
1428
1429size_t luaL_traverse_table(lua_State *L, int index, lua_table_traverser traverser, void *ud)
1430{
1431 if (index > lua_gettop(L))
1432 return 0;
1433 if (!lua_istable(L, index))
1434 return 0;
1435 lua_pushvalue(L, index);
1436 int it = lua_gettop(L);
1437 lua_pushnil(L);
1438 size_t keys_count = 0;
1439 while (lua_next(L, it))
1440 {
1441 keys_count += 1;
1442 if (nullptr != traverser)
1443 traverser(L, ud);
1444 lua_pop(L, 1);
1445 }
1446 lua_pop(L, 1);
1447 return keys_count;
1448}
1449
1450size_t luaL_count_global_variables(lua_State *L)
1451{

Calls 4

lua_gettopFunction · 0.85
lua_pushvalueFunction · 0.85
lua_pushnilFunction · 0.85
lua_nextFunction · 0.85

Tested by

no test coverage detected