optimisation: mmu: combine if statements
Change in memory: Flash: -6 bytes SRAM: 0 bytes
This commit is contained in:
parent
4d90ecbcc4
commit
420f745bed
|
|
@ -705,9 +705,8 @@ void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) {
|
|||
*dst++ = '<';
|
||||
for (uint8_t i = 0; i < lrb; ++i) {
|
||||
uint8_t b = lastReceivedBytes[i];
|
||||
if (b < 32)
|
||||
b = '.';
|
||||
if (b > 127)
|
||||
// Check for printable character, including space
|
||||
if (b < 32 || b > 127)
|
||||
b = '.';
|
||||
*dst++ = b;
|
||||
}
|
||||
|
|
@ -721,9 +720,8 @@ void ProtocolLogic::LogRequestMsg(const uint8_t *txbuff, uint8_t size) {
|
|||
static char lastMsg[rqs] = "";
|
||||
for (uint8_t i = 0; i < size; ++i) {
|
||||
uint8_t b = txbuff[i];
|
||||
if (b < 32)
|
||||
b = '.';
|
||||
if (b > 127)
|
||||
// Check for printable character, including space
|
||||
if (b < 32 || b > 127)
|
||||
b = '.';
|
||||
tmp[i + 1] = b;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue