Skip to content

Commit a870474

Browse files
authored
Removed redundant check before closing the file handle
1 parent 8e27fe4 commit a870474

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

wled00/file.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void closeFile() {
3838
DEBUGFS_PRINT(F("Close -> "));
3939
uint32_t s = millis();
4040
#endif
41-
if (f) f.close(); // only close if we have an open file
41+
f.close(); // "if (f)" check is aleady done inside f.close(), and f cannot be nullptr -> no need for double checking before closing the file handle.
4242
DEBUGFS_PRINTF("took %lu ms\n", millis() - s);
4343
doCloseFile = false;
4444
}

0 commit comments

Comments
 (0)