1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-29 22:24:26 +00:00
This commit is contained in:
J. Nick Koston
2025-07-06 18:44:19 -05:00
parent 0900fd3cea
commit 033c469250

View File

@@ -155,7 +155,15 @@ class Scheduler {
return false;
}
const char *item_name = item->get_name();
return item_name != nullptr && strcmp(name_cstr, item_name) == 0;
if (item_name == nullptr) {
return false;
}
// Fast path: if pointers are equal (common with string deduplication)
if (item_name == name_cstr) {
return true;
}
// Slow path: compare string contents
return strcmp(name_cstr, item_name) == 0;
}
// Helper to execute a scheduler item