Skip to content

Commit 0562378

Browse files
committed
Use break when giving up on a settings file - it's cleaner
1 parent 2a8457d commit 0562378

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Firmware/RTK_Everywhere/NVM.ino

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -840,8 +840,7 @@ bool loadSystemSettingsFromFileLFS(char *fileName, const char *findMe, char *fou
840840
{
841841
// If we can't read the first line of the settings file, give up
842842
systemPrintln("Giving up on settings file");
843-
settingsFile.close();
844-
return (false);
843+
break;
845844
}
846845
}
847846
else
@@ -856,7 +855,6 @@ bool loadSystemSettingsFromFileLFS(char *fileName, const char *findMe, char *fou
856855
{
857856
// If we can't read the first line of the settings file, give up
858857
systemPrintln("Giving up on settings file");
859-
settingsFile.close();
860858
break;
861859
}
862860
}
@@ -877,7 +875,7 @@ bool loadSystemSettingsFromFileLFS(char *fileName, const char *findMe, char *fou
877875
}
878876
}
879877
strncpy(found, ptr, len);
880-
break;
878+
break; // We are done
881879
}
882880
}
883881
}
@@ -934,8 +932,7 @@ bool printSystemSettingsFromFileLFS(char *fileName)
934932
{
935933
// If we can't read the first line of the settings file, give up
936934
systemPrintln("Giving up on settings file");
937-
settingsFile.close();
938-
return (false);
935+
break;
939936
}
940937
}
941938
else

0 commit comments

Comments
 (0)