MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / is_array

Function is_array

lua/sp.c:5546–5557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5544}
5545
5546static int is_array(Lua L)
5547{
5548 int n = luaL_getn(L, -1);
5549 if (n < 1) return 0;
5550 lua_pushnumber(L, n);
5551 if (lua_next(L, -2)) {
5552 // not array: there is stuff after numeric index
5553 lua_pop(L, 2);
5554 return 0;
5555 }
5556 return 1;
5557}
5558
5559// value to convert is on top of stack
5560static cson_value *table_to_cson(Lua L, int lvl, json_conv *conv)

Callers 1

table_to_csonFunction · 0.85

Calls 3

luaL_getnFunction · 0.85
lua_pushnumberFunction · 0.85
lua_nextFunction · 0.85

Tested by

no test coverage detected