mirror of
https://github.com/esphome/esphome.git
synced 2026-02-24 02:08:23 -07:00
Pass ProtoWriteBuffer by reference instead of by value in virtual encode() methods. This avoids copying both buffer_ and pos_ pointers for every encode call - only a single pointer is passed. Also simplifies encode_message since child writes directly advance the shared pos_. Adds debug_check_size_ to verify calculate_size matches actual encode output.