From 88424d256390e9c8aad24ed185381dc1297f51d5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 22 Sep 2008 02:09:16 -0700 Subject: songvec: remove songvec_prune Any pruned files will be noticed during update and pruned from the live database, so this inefficient function can go away and never come back. --- src/song.c | 2 -- src/songvec.c | 23 ----------------------- src/songvec.h | 2 -- 3 files changed, 27 deletions(-) (limited to 'src') diff --git a/src/song.c b/src/song.c index 9be586281..abf8f348b 100644 --- a/src/song.c +++ b/src/song.c @@ -234,8 +234,6 @@ void readSongInfoIntoList(FILE * fp, Directory * parentDir) if (song) insertSongIntoList(sv, song); - if (isUpdatingDB()) /* only needed until we get rid of forked update */ - songvec_prune(sv); } int updateSongInfo(Song * song) diff --git a/src/songvec.c b/src/songvec.c index ac84e7f8e..d416573ce 100644 --- a/src/songvec.c +++ b/src/songvec.c @@ -96,26 +96,3 @@ int songvec_write(struct songvec *sv, int fd, int extra) return 0; } - -/* - * Removes missing songs from a songvec. This function is only temporary - * as updating will be moved into a thread and updating shared memory... - */ -#include "path.h" -#include "ls.h" -void songvec_prune(struct songvec *sv) -{ - int i; - char tmp[MPD_PATH_MAX]; - struct stat sb; - - for (i = sv->nr; --i >= 0; ) { - Song *song = sv->base[i]; - assert(song); - if (!myStat(get_song_url(tmp, song), &sb)) - continue; - songvec_delete(sv, song); - freeSong(song); - i = sv->nr; - } -} diff --git a/src/songvec.h b/src/songvec.h index 5952f871f..abbc9365b 100644 --- a/src/songvec.h +++ b/src/songvec.h @@ -21,6 +21,4 @@ void songvec_free(struct songvec *sv); int songvec_write(struct songvec *sv, int fd, int extra); -void songvec_prune(struct songvec *sv); - #endif /* SONGVEC_H */ -- cgit v1.2.3