chore: Cleanup

This commit is contained in:
robshape 2023-04-22 09:07:58 +02:00
parent f14606e285
commit 2c9d7642ae

View file

@ -394,9 +394,8 @@ static int FavoriteArray_splice(Array* self, int index) {
self->items[i] = self->items[i+1]; self->items[i] = self->items[i+1];
} }
--self->count; --self->count;
return index;
} }
return -1; return index;
} }
/////////////////////////////////////// ///////////////////////////////////////
@ -466,9 +465,7 @@ static void toggleFavorite(char* path) {
int id = FavoriteArray_indexOf(favorites, path); int id = FavoriteArray_indexOf(favorites, path);
if (id==-1) { // add if (id==-1) { // add
Array_unshift(favorites, Favorite_new(path)); Array_unshift(favorites, Favorite_new(path));
} } else { // remove
else { // remove
FavoriteArray_splice(favorites, id); FavoriteArray_splice(favorites, id);
} }
saveFavorites(); saveFavorites();