diff options
author | Max Kellermann <max@duempel.org> | 2009-01-04 17:28:34 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-04 17:28:34 +0100 |
commit | 6a008b52d1004f56182911f2a635136d0d097918 (patch) | |
tree | b90b518a02803a99407180c6730333c97932e26c | |
parent | ff72fff68da8edc9d28e0022425893d1641f21e5 (diff) | |
download | mpd-6a008b52d1004f56182911f2a635136d0d097918.tar.gz mpd-6a008b52d1004f56182911f2a635136d0d097918.tar.xz mpd-6a008b52d1004f56182911f2a635136d0d097918.zip |
update: removed struct delete_data
The struct delete_data has only one member left and can be eliminated.
-rw-r--r-- | src/update.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/update.c b/src/update.c index 0cf73ff80..72fee3946 100644 --- a/src/update.c +++ b/src/update.c @@ -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 |