From daaaa133180d6f3ca61a92e5523ff8c2d5465c7d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 20 Aug 2026 17:59:27 -0500 Subject: [PATCH] Drop the unused non-ESP8266 forward of str_contains_ignore_case_p --- esphome/core/helpers.h | 4 ---- tests/components/core/helpers_test.cpp | 9 --------- 2 files changed, 13 deletions(-) diff --git a/esphome/core/helpers.h b/esphome/core/helpers.h index 978cb18bf5..c1071e1553 100644 --- a/esphome/core/helpers.h +++ b/esphome/core/helpers.h @@ -1007,10 +1007,6 @@ inline bool str_contains_ignore_case(const char *haystack, const char *needle) { return strcasestr(haystack, needle) != nullptr; #endif // defined(USE_LIBRETINY) || defined(USE_RP2) || defined(USE_ZEPHYR) } -/// PROGMEM is a no-op on this platform, so the flash-needle variant is the plain check. -inline bool str_contains_ignore_case_p(const char *haystack, const char *needle) { - return str_contains_ignore_case(haystack, needle); -} #endif // USE_ESP8266 // str_truncate moved to alloc_helpers.h - remove this include before 2026.11.0 diff --git a/tests/components/core/helpers_test.cpp b/tests/components/core/helpers_test.cpp index 3d143dc26d..521ae10e5c 100644 --- a/tests/components/core/helpers_test.cpp +++ b/tests/components/core/helpers_test.cpp @@ -90,10 +90,6 @@ TEST(StringContainsIgnoreCaseTest, NullPointerAlwaysFalse) { EXPECT_FALSE(str_contains_ignore_case(haystack, needle)); EXPECT_FALSE(str_contains_ignore_case("Hello World", needle)); EXPECT_FALSE(str_contains_ignore_case(haystack, "anything")); - - EXPECT_FALSE(str_contains_ignore_case_p(haystack, needle)); - EXPECT_FALSE(str_contains_ignore_case_p("Hello World", needle)); - EXPECT_FALSE(str_contains_ignore_case_p(haystack, "anything")); } TEST(StringContainsIgnoreCaseTest, EmptySearchMatches) { @@ -128,14 +124,9 @@ TEST(StringContainsIgnoreCaseTest, FallbackMatchesLibc) { for (const char *needle : {"", "Hello", "hELLO", "HELLO", "Hell", "world", "World", "Heaven", "Hello!", "d"}) { EXPECT_EQ(str_contains_ignore_case_fallback(haystack, needle), str_contains_ignore_case(haystack, needle)) << "needle: " << needle; - EXPECT_EQ(str_contains_ignore_case_p(haystack, needle), str_contains_ignore_case(haystack, needle)) - << "needle: " << needle; } EXPECT_EQ(str_contains_ignore_case_fallback("", ""), str_contains_ignore_case("", "")); EXPECT_EQ(str_contains_ignore_case_fallback("ab", "abc"), str_contains_ignore_case("ab", "abc")); - EXPECT_TRUE(str_contains_ignore_case_p("", "")); - EXPECT_FALSE(str_contains_ignore_case_p("", "a")); - EXPECT_FALSE(str_contains_ignore_case_p("ab", "abc")); } } // namespace esphome