Commit 28d39948 authored by Eric Wong's avatar Eric Wong Committed by Max Kellermann

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.
parent 3f0ae13c
...@@ -149,7 +149,4 @@ void readSongInfoIntoList(FILE *fp, struct songvec *sv, ...@@ -149,7 +149,4 @@ void readSongInfoIntoList(FILE *fp, struct songvec *sv,
if (song) if (song)
insertSongIntoList(sv, song); insertSongIntoList(sv, song);
if (isUpdatingDB()) /* only needed until we get rid of forked update */
songvec_prune(sv);
} }
...@@ -64,26 +64,3 @@ void songvec_free(struct songvec *sv) ...@@ -64,26 +64,3 @@ void songvec_free(struct songvec *sv)
sv->base = NULL; sv->base = NULL;
sv->nr = 0; sv->nr = 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;
}
}
...@@ -19,6 +19,4 @@ void songvec_add(struct songvec *sv, Song *add); ...@@ -19,6 +19,4 @@ void songvec_add(struct songvec *sv, Song *add);
void songvec_free(struct songvec *sv); void songvec_free(struct songvec *sv);
void songvec_prune(struct songvec *sv);
#endif /* SONGVEC_H */ #endif /* SONGVEC_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment