optimize readUnitName (-6 bytes)

This commit is contained in:
Josh Goebel 2017-03-20 20:28:51 -04:00 committed by Scott Allen
parent 5877208a57
commit 1280160f89
1 changed files with 4 additions and 4 deletions

View File

@ -995,12 +995,12 @@ uint8_t Arduboy2Base::readUnitName(char* name)
for (dest = 0; dest < ARDUBOY_UNIT_NAME_LEN; dest++) for (dest = 0; dest < ARDUBOY_UNIT_NAME_LEN; dest++)
{ {
if ((val = EEPROM.read(src)) == 0x00 || (byte)val == 0xFF) val = EEPROM.read(src);
{
break;
}
name[dest] = val; name[dest] = val;
src++; src++;
if (val == 0x00 || (byte)val == 0xFF) {
break;
}
} }
name[dest] = 0x00; name[dest] = 0x00;