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

Function mp_decode_to_lua_hash

deps/lua/src/lua_cmsgpack.c:565–575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

563}
564
565void mp_decode_to_lua_hash(lua_State *L, mp_cur *c, size_t len) {
566 assert(len <= UINT_MAX);
567 lua_newtable(L);
568 while(len--) {
569 mp_decode_to_lua_type(L,c); /* key */
570 if (c->err) return;
571 mp_decode_to_lua_type(L,c); /* value */
572 if (c->err) return;
573 lua_settable(L,-3);
574 }
575}
576
577/* Decode a Message Pack raw object pointed by the string cursor 'c' to
578 * a Lua type, that is left as the only result on the stack. */

Callers 1

lua_cmsgpack.cFile · 0.85

Calls 1

lua_settableFunction · 0.85

Tested by

no test coverage detected