IRUtils:typeToString() — simplify (#2002)

Remove redundant code.
This commit is contained in:
Дилян Палаузов
2023-06-10 01:41:36 +02:00
committed by GitHub
parent 9d0a9196fd
commit 4e4b158efe

View File

@@ -145,16 +145,12 @@ String typeToString(const decode_type_t protocol, const bool isRepeat) {
result = kUnknownStr;
} else {
auto *ptr = reinterpret_cast<const char*>(kAllProtocolNamesStr);
if (protocol > kLastDecodeType || protocol == decode_type_t::UNKNOWN) {
result = kUnknownStr;
} else {
for (uint16_t i = 0; i <= protocol && STRLEN(ptr); i++) {
if (i == protocol) {
result = FPSTR(ptr);
break;
}
ptr += STRLEN(ptr) + 1;
for (uint16_t i = 0; i <= protocol && STRLEN(ptr); i++) {
if (i == protocol) {
result = FPSTR(ptr);
break;
}
ptr += STRLEN(ptr) + 1;
}
}
if (isRepeat) {