chore: Cleanup
This commit is contained in:
parent
f14606e285
commit
2c9d7642ae
1 changed files with 2 additions and 5 deletions
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue