MCPcopy Create free account
hub / github.com/Tencent/UnLua / lpbD_repeated

Function lpbD_repeated

Plugins/UnLuaExtensions/LuaProtobuf/Source/src/pb.cpp:1842–1857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1840}
1841
1842static void lpbD_repeated(lpb_Env *e, const pb_Field *f, uint32_t tag) {
1843 lua_State *L = e->L;
1844 if (pb_gettype(tag) != PB_TBYTES
1845 || (!f->packed && pb_wtypebytype(f->type_id) == PB_TBYTES)) {
1846 lpbD_field(e, f, tag);
1847 lua_rawseti(L, -2, (lua_Integer)lua_rawlen(L, -2) + 1);
1848 } else {
1849 int len = (int)lua_rawlen(L, -1);
1850 pb_Slice p, *s = e->s;
1851 lpb_readbytes(L, s, &p);
1852 while (p.p < p.end) {
1853 lpb_withinput(e, &p, lpbD_rawfield(e, f));
1854 lua_rawseti(L, -2, ++len);
1855 }
1856 }
1857}
1858
1859static int lpbD_message(lpb_Env *e, const pb_Type *t) {
1860 lua_State *L = e->L;

Callers 2

lpbD_messageFunction · 0.85
lpb_unpackfieldFunction · 0.85

Calls 5

pb_wtypebytypeFunction · 0.85
lpbD_fieldFunction · 0.85
lua_rawsetiFunction · 0.85
lpb_readbytesFunction · 0.85
lpbD_rawfieldFunction · 0.85

Tested by

no test coverage detected