| 55 | Encoder::~Encoder() =default; |
| 56 | |
| 57 | void Encoder::init() { |
| 58 | // Initial state has a placeholder collection on the stack, which will contain the real |
| 59 | // root value. |
| 60 | resetStack(); |
| 61 | _items->reset(kSpecialTag); |
| 62 | _items->reserve(1); |
| 63 | } |
| 64 | |
| 65 | void Encoder::resetStack() { |
| 66 | _items = &_stack[0]; |