From 2a6acc04a12e8e0b75108f682b0cf7f5d0546830 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 21 Jan 2012 11:31:58 +0100 Subject: dirvec: remove unused functions _clear(), _for_each() --- src/dirvec.c | 24 ------------------------ src/dirvec.h | 9 --------- 2 files changed, 33 deletions(-) (limited to 'src') diff --git a/src/dirvec.c b/src/dirvec.c index fa6b7b5f6..520a48513 100644 --- a/src/dirvec.c +++ b/src/dirvec.c @@ -113,27 +113,3 @@ void dirvec_destroy(struct dirvec *dv) dv->base = NULL; } } - -int dirvec_for_each(const struct dirvec *dv, - int (*fn)(struct directory *, void *), void *arg) -{ - size_t i; - size_t prev_nr; - - db_lock(); - for (i = 0; i < dv->nr; ) { - struct directory *dir = dv->base[i]; - - assert(dir); - prev_nr = dv->nr; - db_unlock(); - if (fn(dir, arg) < 0) - return -1; - db_lock(); /* dv->nr may change in fn() */ - if (prev_nr == dv->nr) - ++i; - } - db_unlock(); - - return 0; -} diff --git a/src/dirvec.h b/src/dirvec.h index b9d730a17..8d840f469 100644 --- a/src/dirvec.h +++ b/src/dirvec.h @@ -35,15 +35,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); - #endif /* DIRVEC_H */ -- cgit v1.2.3