Slightly optimise file reader

This commit is contained in:
suchmememanyskill
2024-01-23 20:07:06 +01:00
parent 2a2fff27d6
commit dd20c11d8b

View File

@@ -53,8 +53,10 @@ FILESYSTEM_FILE* get_files(int limit){
file_iter++;
}
if (file_iter == files.end() && files.size() >= limit)
continue;
// Little inefficient as it always allocates a string, even if it doesn't have to
f.name = (char*)malloc(strlen(path) + 1);
if (f.name == NULL){
Serial.println("Failed to allocate memory");