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++ = '<';
|
*dst++ = '<';
|
||||||
for (uint8_t i = 0; i < lrb; ++i) {
|
for (uint8_t i = 0; i < lrb; ++i) {
|
||||||
uint8_t b = lastReceivedBytes[i];
|
uint8_t b = lastReceivedBytes[i];
|
||||||
if (b < 32)
|
// Check for printable character, including space
|
||||||
b = '.';
|
if (b < 32 || b > 127)
|
||||||
if (b > 127)
|
|
||||||
b = '.';
|
b = '.';
|
||||||
*dst++ = b;
|
*dst++ = b;
|
||||||
}
|
}
|
||||||
|
|
@ -721,9 +720,8 @@ void ProtocolLogic::LogRequestMsg(const uint8_t *txbuff, uint8_t size) {
|
||||||
static char lastMsg[rqs] = "";
|
static char lastMsg[rqs] = "";
|
||||||
for (uint8_t i = 0; i < size; ++i) {
|
for (uint8_t i = 0; i < size; ++i) {
|
||||||
uint8_t b = txbuff[i];
|
uint8_t b = txbuff[i];
|
||||||
if (b < 32)
|
// Check for printable character, including space
|
||||||
b = '.';
|
if (b < 32 || b > 127)
|
||||||
if (b > 127)
|
|
||||||
b = '.';
|
b = '.';
|
||||||
tmp[i + 1] = b;
|
tmp[i + 1] = b;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue