mirror of
https://github.com/esphome/esphome.git
synced 2026-09-03 19:46:02 +00: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.