dirvec: remove unused functions _clear(), _for_each()

This commit is contained in:
Max Kellermann 2012-01-21 11:31:58 +01:00
parent a467128093
commit 2a6acc04a1
2 changed files with 0 additions and 33 deletions

View File

@ -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;
}

View File

@ -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 */