MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / luaL_getn

Function luaL_getn

deps/lua/src/lauxlib.c:321–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319
320
321LUALIB_API int luaL_getn (lua_State *L, int t) {
322 int n;
323 t = abs_index(L, t);
324 lua_pushliteral(L, "n"); /* try t.n */
325 lua_rawget(L, t);
326 if ((n = checkint(L, 1)) >= 0) return n;
327 getsizes(L); /* else try sizes[t] */
328 lua_pushvalue(L, t);
329 lua_rawget(L, -2);
330 if ((n = checkint(L, 2)) >= 0) return n;
331 return (int)lua_objlen(L, t);
332}
333
334#endif
335

Callers 2

luaB_unpackFunction · 0.85
tconcatFunction · 0.85

Calls 5

lua_rawgetFunction · 0.85
checkintFunction · 0.85
getsizesFunction · 0.85
lua_pushvalueFunction · 0.85
lua_objlenFunction · 0.85

Tested by

no test coverage detected