From 6b180f7be941c4db6bb105b26ee6ee117322ad15 Mon Sep 17 00:00:00 2001 From: Kevin Ahrendt Date: Wed, 29 Jul 2026 07:58:35 -0400 Subject: [PATCH] [voice_assistant] Use starts_with for the model URL check clang-tidy's modernize-use-starts-ends-with flags the compare calls. --- esphome/components/voice_assistant/voice_assistant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/voice_assistant/voice_assistant.cpp b/esphome/components/voice_assistant/voice_assistant.cpp index 76b999862b..deb1b55a23 100644 --- a/esphome/components/voice_assistant/voice_assistant.cpp +++ b/esphome/components/voice_assistant/voice_assistant.cpp @@ -1474,7 +1474,7 @@ void VoiceAssistant::model_load_task(void *params) { } // 3. Resolve a relative "model" filename against the manifest URL; absolute URLs are used as-is. - if (model_url.compare(0, 7, "http://") != 0 && model_url.compare(0, 8, "https://") != 0) { + if (!model_url.starts_with("http://") && !model_url.starts_with("https://")) { size_t slash_pos = cached_ww.url.find_last_of('/'); if (slash_pos != std::string::npos) { model_url = cached_ww.url.substr(0, slash_pos + 1) + model_url;