update: removed struct delete_data

The struct delete_data has only one member left and can be eliminated.
This commit is contained in:
Max Kellermann 2009-01-04 17:28:34 +01:00
parent ff72fff68d
commit 6a008b52d1

View File

@ -169,21 +169,17 @@ delete_name_in(struct directory *parent, const char *name)
}
}
struct delete_data {
struct directory *dir;
};
/* passed to songvec_for_each */
static int
delete_song_if_removed(struct song *song, void *_data)
{
struct delete_data *data = _data;
struct directory *dir = _data;
char *path;
struct stat st;
if ((path = map_song_fs(song)) == NULL ||
stat(path, &st) < 0 || !S_ISREG(st.st_mode)) {
delete_song(data->dir, song);
delete_song(dir, song);
modified = true;
}
@ -213,7 +209,6 @@ removeDeletedFromDirectory(struct directory *directory)
{
int i;
struct dirvec *dv = &directory->children;
struct delete_data data;
for (i = dv->nr; --i >= 0; ) {
if (directory_exists(dv->base[i]))
@ -224,8 +219,7 @@ removeDeletedFromDirectory(struct directory *directory)
modified = true;
}
data.dir = directory;
songvec_for_each(&directory->songs, delete_song_if_removed, &data);
songvec_for_each(&directory->songs, delete_song_if_removed, directory);
}
static int