Skip to content

Commit 4e4b158

Browse files
IRUtils:typeToString() — simplify (#2002)
Remove redundant code.
1 parent 9d0a919 commit 4e4b158

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/IRutils.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,12 @@ String typeToString(const decode_type_t protocol, const bool isRepeat) {
145145
result = kUnknownStr;
146146
} else {
147147
auto *ptr = reinterpret_cast<const char*>(kAllProtocolNamesStr);
148-
if (protocol > kLastDecodeType || protocol == decode_type_t::UNKNOWN) {
149-
result = kUnknownStr;
150-
} else {
151-
for (uint16_t i = 0; i <= protocol && STRLEN(ptr); i++) {
152-
if (i == protocol) {
153-
result = FPSTR(ptr);
154-
break;
155-
}
156-
ptr += STRLEN(ptr) + 1;
148+
for (uint16_t i = 0; i <= protocol && STRLEN(ptr); i++) {
149+
if (i == protocol) {
150+
result = FPSTR(ptr);
151+
break;
157152
}
153+
ptr += STRLEN(ptr) + 1;
158154
}
159155
}
160156
if (isRepeat) {

0 commit comments

Comments
 (0)