mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-04 22:33:36 -07:00
Archive favorites loop cleanup
This commit is contained in:
@@ -59,10 +59,7 @@ uint16_t archive_favorites_count(void* context) {
|
||||
uint16_t lines = 0;
|
||||
|
||||
if(result) {
|
||||
while(1) {
|
||||
if(!archive_favorites_read_line(file, buffer)) {
|
||||
break;
|
||||
}
|
||||
while(archive_favorites_read_line(file, buffer)) {
|
||||
if(!furi_string_size(buffer)) {
|
||||
continue; // Skip empty lines
|
||||
}
|
||||
@@ -87,10 +84,7 @@ static bool archive_favourites_rescan() {
|
||||
|
||||
bool result = storage_file_open(file, ARCHIVE_FAV_PATH, FSAM_READ, FSOM_OPEN_EXISTING);
|
||||
if(result) {
|
||||
while(1) {
|
||||
if(!archive_favorites_read_line(file, buffer)) {
|
||||
break;
|
||||
}
|
||||
while(archive_favorites_read_line(file, buffer)) {
|
||||
if(!furi_string_size(buffer)) {
|
||||
continue;
|
||||
}
|
||||
@@ -141,10 +135,7 @@ bool archive_favorites_read(void* context) {
|
||||
bool result = storage_file_open(file, ARCHIVE_FAV_PATH, FSAM_READ, FSOM_OPEN_EXISTING);
|
||||
|
||||
if(result) {
|
||||
while(1) {
|
||||
if(!archive_favorites_read_line(file, buffer)) {
|
||||
break;
|
||||
}
|
||||
while(archive_favorites_read_line(file, buffer)) {
|
||||
if(!furi_string_size(buffer)) {
|
||||
continue;
|
||||
}
|
||||
@@ -199,10 +190,7 @@ bool archive_favorites_delete(const char* format, ...) {
|
||||
bool result = storage_file_open(file, ARCHIVE_FAV_PATH, FSAM_READ, FSOM_OPEN_EXISTING);
|
||||
|
||||
if(result) {
|
||||
while(1) {
|
||||
if(!archive_favorites_read_line(file, buffer)) {
|
||||
break;
|
||||
}
|
||||
while(archive_favorites_read_line(file, buffer)) {
|
||||
if(!furi_string_size(buffer)) {
|
||||
continue;
|
||||
}
|
||||
@@ -243,10 +231,7 @@ bool archive_is_favorite(const char* format, ...) {
|
||||
bool result = storage_file_open(file, ARCHIVE_FAV_PATH, FSAM_READ, FSOM_OPEN_EXISTING);
|
||||
|
||||
if(result) {
|
||||
while(1) {
|
||||
if(!archive_favorites_read_line(file, buffer)) {
|
||||
break;
|
||||
}
|
||||
while(archive_favorites_read_line(file, buffer)) {
|
||||
if(!furi_string_size(buffer)) {
|
||||
continue;
|
||||
}
|
||||
@@ -283,10 +268,7 @@ bool archive_favorites_rename(const char* src, const char* dst) {
|
||||
bool result = storage_file_open(file, ARCHIVE_FAV_PATH, FSAM_READ, FSOM_OPEN_EXISTING);
|
||||
|
||||
if(result) {
|
||||
while(1) {
|
||||
if(!archive_favorites_read_line(file, buffer)) {
|
||||
break;
|
||||
}
|
||||
while(archive_favorites_read_line(file, buffer)) {
|
||||
if(!furi_string_size(buffer)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user