MCPcopy Create free account
hub / github.com/PlutoLang/Pluto / tisarray

Function tisarray

src/ltablib.cpp:1044–1059  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1042
1043
1044static int tisarray (lua_State *L) {
1045 luaL_checktype(L, 1, LUA_TTABLE);
1046 if (const auto n = isIndexBasedTable(L, 1)) {
1047 for (lua_Integer k = 1; k != n; ++k) {
1048 if (l_unlikely(lua_geti(L, 1, k) == LUA_TNIL)) {
1049 lua_pop(L, 1);
1050 lua_pushboolean(L, false);
1051 return 1;
1052 }
1053 lua_pop(L, 1);
1054 }
1055 lua_pushboolean(L, true);
1056 }
1057 else lua_pushboolean(L, false);
1058 return 1;
1059}
1060
1061
1062/* }====================================================== */

Callers

nothing calls this directly

Calls 4

luaL_checktypeFunction · 0.85
isIndexBasedTableFunction · 0.85
lua_getiFunction · 0.85
lua_pushbooleanFunction · 0.85

Tested by

no test coverage detected