From 2dbaedbda2b32bdfe8418e64ee6ecd0e8adde72f Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Mon, 15 Dec 2025 12:17:47 +0000 Subject: [PATCH] Simplify condition check - remove redundant bufsize > 0 check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bufsize > 0 check is redundant because the previous if statement already handles all cases where bufsize <= 0, ensuring that by the time we reach this condition, bufsize is always positive. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- esphome/components/http_request/ota/ota_http_request.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/http_request/ota/ota_http_request.cpp b/esphome/components/http_request/ota/ota_http_request.cpp index 6cd3ad8e30..b257518e06 100644 --- a/esphome/components/http_request/ota/ota_http_request.cpp +++ b/esphome/components/http_request/ota/ota_http_request.cpp @@ -143,7 +143,7 @@ uint8_t OtaHttpRequestComponent::do_ota_() { break; } - if (bufsize > 0 && bufsize <= OtaHttpRequestComponent::HTTP_RECV_BUFFER) { + if (bufsize <= OtaHttpRequestComponent::HTTP_RECV_BUFFER) { // add read bytes to MD5 md5_receive.add(buf, bufsize);