diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-10-13 21:54:02 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-13 21:54:02 -0700 |
commit | 396f03db551d585ee3eff4a3a1e6f49283abbc61 (patch) | |
tree | e5566191b76c19e50222e41d7a835e0652a9b2be | |
parent | e5c604feac962f654ba2cb7739ef33b9242cb072 (diff) | |
download | mpd-396f03db551d585ee3eff4a3a1e6f49283abbc61.tar.gz mpd-396f03db551d585ee3eff4a3a1e6f49283abbc61.tar.xz mpd-396f03db551d585ee3eff4a3a1e6f49283abbc61.zip |
{dir,song}vec: remove unused *_destroy routines
Blindly destroying these without freeing the underlying
elements was a bad idea, always. Our iterators suck
less nowadays and we can traverse them and free() each
element safely.
-rw-r--r-- | src/dirvec.c | 11 | ||||
-rw-r--r-- | src/dirvec.h | 7 | ||||
-rw-r--r-- | src/songvec.c | 11 | ||||
-rw-r--r-- | src/songvec.h | 2 |
4 files changed, 0 insertions, 31 deletions
diff --git a/src/dirvec.c b/src/dirvec.c index cb695ac5d..f845c9973 100644 --- a/src/dirvec.c +++ b/src/dirvec.c @@ -74,17 +74,6 @@ void dirvec_add(struct dirvec *dv, struct directory *add) pthread_mutex_unlock(&nr_lock); } -void dirvec_destroy(struct dirvec *dv) -{ - pthread_mutex_lock(&nr_lock); - dv->nr = 0; - pthread_mutex_unlock(&nr_lock); - if (dv->base) { - free(dv->base); - dv->base = NULL; - } -} - int dirvec_for_each(const struct dirvec *dv, int (*fn)(struct directory *, void *), void *arg) { diff --git a/src/dirvec.h b/src/dirvec.h index 6709537b8..0dd7c7a9c 100644 --- a/src/dirvec.h +++ b/src/dirvec.h @@ -14,13 +14,6 @@ int dirvec_delete(struct dirvec *dv, struct directory *del); void dirvec_add(struct dirvec *dv, struct directory *add); -static inline void dirvec_clear(struct dirvec *dv) -{ - dv->nr = 0; -} - -void dirvec_destroy(struct dirvec *dv); - int dirvec_for_each(const struct dirvec *dv, int (*fn)(struct directory *, void *), void *arg); diff --git a/src/songvec.c b/src/songvec.c index 613c448cf..dfab51451 100644 --- a/src/songvec.c +++ b/src/songvec.c @@ -73,17 +73,6 @@ void songvec_add(struct songvec *sv, struct mpd_song *add) pthread_mutex_unlock(&nr_lock); } -void songvec_destroy(struct songvec *sv) -{ - pthread_mutex_lock(&nr_lock); - sv->nr = 0; - pthread_mutex_unlock(&nr_lock); - if (sv->base) { - free(sv->base); - sv->base = NULL; - } -} - int songvec_for_each(const struct songvec *sv, int (*fn)(struct mpd_song *, void *), void *arg) { diff --git a/src/songvec.h b/src/songvec.h index 10a896052..015aa1a9b 100644 --- a/src/songvec.h +++ b/src/songvec.h @@ -15,8 +15,6 @@ int songvec_delete(struct songvec *sv, const struct mpd_song *del); void songvec_add(struct songvec *sv, struct mpd_song *add); -void songvec_destroy(struct songvec *sv); - int songvec_for_each(const struct songvec *sv, int (*fn)(struct mpd_song *, void *), void *arg); |