MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / tableLength

Method tableLength

source/core/StarLua.cpp:853–865  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

851}
852
853LuaInt LuaEngine::tableLength(bool raw, int handleIndex) {
854 if (raw) {
855 return lua_rawlen(m_handleThread, handleIndex);
856
857 } else {
858 lua_checkstack(m_state, 1);
859 pushHandle(m_state, handleIndex);
860 lua_len(m_state, -1);
861 LuaInt len = lua_tointeger(m_state, -1);
862 lua_pop(m_state, 2);
863 return len;
864 }
865}
866
867void LuaEngine::tableIterate(int handleIndex, function<bool(LuaValue key, LuaValue value)> iterator) {
868 lua_checkstack(m_state, 4);

Callers 2

lengthMethod · 0.80
rawLengthMethod · 0.80

Calls 3

lua_rawlenFunction · 0.85
lua_checkstackFunction · 0.85
lua_lenFunction · 0.85

Tested by

no test coverage detected