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

Function lpbE_pack

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

Source from the content-addressed store, hash-verified

1685}
1686
1687static int lpbE_pack(lpb_Env* e, const pb_Type* t, int idx) {
1688 unsigned i;
1689 lua_State* L = e->L;
1690 pb_Field** f = pb_sortfield((pb_Type*)t);
1691 for (i = 0; i < t->field_count; i++) {
1692 int index = idx + i;
1693 if (!lua_isnoneornil(L, index)) {
1694 lpb_encode_onefield(e, t, f[i], index);
1695 }
1696 }
1697 return 0;
1698}
1699
1700static int Lpb_pack(lua_State* L) {
1701 lpb_State* LS = lpb_lstate(L);

Callers 1

Lpb_packFunction · 0.85

Calls 2

pb_sortfieldFunction · 0.85
lpb_encode_onefieldFunction · 0.85

Tested by

no test coverage detected