diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2010-05-24 22:29:53 +0200 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2016-12-11 22:05:40 +0100 |
commit | cdbac47f9d811eb077c405ceecc6f84a0f8504af (patch) | |
tree | f0a0b16e3c92d70f756ec3e2a2c05956d3224686 /fetchmail.c | |
parent | b1e81d36e5a324d1e5257de396a3ff8ff99f71ca (diff) | |
download | fetchmail-cdbac47f9d811eb077c405ceecc6f84a0f8504af.tar.gz fetchmail-cdbac47f9d811eb077c405ceecc6f84a0f8504af.tar.bz2 fetchmail-cdbac47f9d811eb077c405ceecc6f84a0f8504af.zip |
UIDL database speedup with Patricia trees.
Import Rainer Weikusat's code that uses Patricia trees instead of linear
lists.
Snapshot Rainer's patch 2010-05-24 19:30:42
Diffstat (limited to 'fetchmail.c')
-rw-r--r-- | fetchmail.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/fetchmail.c b/fetchmail.c index 8b0a5c3d..bcd13a50 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -1597,6 +1597,14 @@ static int query_host(struct query *ctl) return(st); } +static int print_id_of(struct uid_db_record *rec, void *unused) +{ + (void)unused; + + printf("\t%s\n", rec->id); + return 0; +} + static void dump_params (struct runctl *runp, struct query *querylist, flag implicit) /* display query parameters in English */ @@ -2000,20 +2008,14 @@ static void dump_params (struct runctl *runp, if (ctl->server.protocol > P_POP2 && MAILBOX_PROTOCOL(ctl)) { - if (!ctl->oldsaved) + int count; + + if (!(count = uid_db_n_records(&ctl->oldsaved))) printf(GT_(" No UIDs saved from this host.\n")); else { - struct idlist *idp; - int count = 0; - - for (idp = ctl->oldsaved; idp; idp = idp->next) - ++count; - printf(GT_(" %d UIDs saved.\n"), count); - if (outlevel >= O_VERBOSE) - for (idp = ctl->oldsaved; idp; idp = idp->next) - printf("\t%s\n", idp->id); + traverse_uid_db(&ctl->oldsaved, print_id_of, NULL); } } |