From a198df34eec6f6988faa259533c5e3734979ec55 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 9 Feb 2026 09:39:49 -0600 Subject: [PATCH] Remove unnecessary early guard --- esphome/components/rd03d/rd03d.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/esphome/components/rd03d/rd03d.cpp b/esphome/components/rd03d/rd03d.cpp index 90ac87f93f..e4dbdf41cb 100644 --- a/esphome/components/rd03d/rd03d.cpp +++ b/esphome/components/rd03d/rd03d.cpp @@ -81,12 +81,8 @@ void RD03DComponent::dump_config() { } void RD03DComponent::loop() { - // Early return avoids stack adjustment for the batch buffer below. - // loop() runs ~7000/min so most calls have nothing to read. + // Read all available bytes in batches to reduce UART call overhead. int avail = this->available(); - if (avail <= 0) - return; - uint8_t buf[64]; while (avail > 0) { size_t to_read = std::min(static_cast(avail), sizeof(buf));