| 1633 | } |
| 1634 | |
| 1635 | static void lpb_encode_onefield(lpb_Env *e, const pb_Type *t, const pb_Field *f, int idx) { |
| 1636 | if (f->type && f->type->is_map) |
| 1637 | lpbE_map(e, f, idx); |
| 1638 | else if (f->repeated) |
| 1639 | lpbE_repeated(e, f, idx); |
| 1640 | else if (!f->type || !f->type->is_dead) |
| 1641 | lpbE_tagfield(e, f, t->is_proto3 && !f->oneof_idx, idx); |
| 1642 | } |
| 1643 | |
| 1644 | static void lpbE_encode(lpb_Env *e, const pb_Type *t, int idx) { |
| 1645 | lua_State *L = e->L; |
no test coverage detected