From e5df43b9347b929b65b2d432c7df48bf77ca63ba Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 7 Jul 2025 14:38:49 -0500 Subject: [PATCH] cleanup --- esphome/components/bluetooth_proxy/bluetooth_proxy.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp b/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp index e0370328f2..a5e8ec0860 100644 --- a/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp +++ b/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp @@ -59,10 +59,12 @@ bool BluetoothProxy::parse_device(const esp32_ble_tracker::ESPBTDevice &device) // This achieves ~97% WiFi MTU utilization while staying under the limit static constexpr size_t FLUSH_BATCH_SIZE = 16; -// Global batch buffer to avoid guard variable (saves 8 bytes) +namespace { +// Batch buffer in anonymous namespace to avoid guard variable (saves 8 bytes) // This is initialized at program startup before any threads // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -static std::vector batch_buffer; +std::vector batch_buffer; +} // namespace static std::vector &get_batch_buffer() { return batch_buffer; }