mirror of
https://github.com/esphome/esphome.git
synced 2026-02-25 04:45:29 -07:00
[api] Remove unused reserve from APIServer constructor
All send paths already call prepare_first_message_buffer which does clear() + reserve() with the exact needed size, making the initial reserve(64) redundant. Removing it saves 68 bytes of flash.
This commit is contained in:
@@ -28,11 +28,7 @@ static const char *const TAG = "api";
|
||||
// APIServer
|
||||
APIServer *global_api_server = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
|
||||
APIServer::APIServer() {
|
||||
global_api_server = this;
|
||||
// Pre-allocate shared write buffer
|
||||
shared_write_buffer_.reserve(64);
|
||||
}
|
||||
APIServer::APIServer() { global_api_server = this; }
|
||||
|
||||
void APIServer::setup() {
|
||||
ControllerRegistry::register_controller(this);
|
||||
|
||||
Reference in New Issue
Block a user