From 03968925eb1a8a76ede6d80b82ab1d6c78df6b37 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 10 Apr 2020 14:38:00 +0200 Subject: [PATCH] Small optimization in Group Topic --- tasmota/support_command.ino | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index 3df48484a..366bc403c 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -186,9 +186,10 @@ void CommandHandler(char* topicBuf, char* dataBuf, uint32_t data_len) uint32_t real_index = SET_MQTT_GRP_TOPIC; for (uint32_t i = 0; i < MAX_GROUP_TOPICS; i++) { if (1 == i) { real_index = SET_MQTT_GRP_TOPIC2 -1; } - if (strlen(SettingsText(real_index +i))) { - grpflg = (strstr(topicBuf, SettingsText(real_index +i)) != nullptr); - if (grpflg) { break; } + char *group_topic = SettingsText(real_index +i); + if (*group_topic && strstr(topicBuf, group_topic) != nullptr) { + grpflg = true; + break; } }