From 1280160f8945466d55035757262bad85588ff6a8 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Mon, 20 Mar 2017 20:28:51 -0400 Subject: [PATCH] optimize readUnitName (-6 bytes) --- src/Arduboy2.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Arduboy2.cpp b/src/Arduboy2.cpp index 5b1fbd1..b201a33 100644 --- a/src/Arduboy2.cpp +++ b/src/Arduboy2.cpp @@ -995,12 +995,12 @@ uint8_t Arduboy2Base::readUnitName(char* name) for (dest = 0; dest < ARDUBOY_UNIT_NAME_LEN; dest++) { - if ((val = EEPROM.read(src)) == 0x00 || (byte)val == 0xFF) - { - break; - } + val = EEPROM.read(src); name[dest] = val; src++; + if (val == 0x00 || (byte)val == 0xFF) { + break; + } } name[dest] = 0x00;