]> Pileus Git - ~andy/fetchmail/commitdiff
Reduce complexity of adding UIDs in fastuidl.
authorMatthias Andree <matthias.andree@gmx.de>
Sat, 24 Apr 2010 03:14:02 +0000 (05:14 +0200)
committerMatthias Andree <matthias.andree@gmx.de>
Sun, 12 Dec 2010 00:21:45 +0000 (01:21 +0100)
pop3.c

diff --git a/pop3.c b/pop3.c
index 04ea97bff11d375f0eb2c4e8a3e4bd8565afd28a..3def391b77fb5c591afcebdb60cb85ed2944e6f7 100644 (file)
--- a/pop3.c
+++ b/pop3.c
@@ -812,6 +812,7 @@ static int pop3_fastuidl( int sock,  struct query *ctl, unsigned int count, int
     int ok;
     unsigned int first_nr, last_nr, try_nr;
     char id [IDLEN+1];
+    struct idlist *savep = NULL; /** pointer to cache save_str result, speeds up saves */
 
     first_nr = 0;
     last_nr = count + 1;
@@ -853,8 +854,8 @@ static int pop3_fastuidl( int sock,  struct query *ctl, unsigned int count, int
            last_nr = try_nr;
 
            /* save it */
-           newl = save_str(&ctl->oldsaved, id, UID_UNSEEN);
-           newl->val.status.num = try_nr;
+           savep = save_str(savep ? &savep : &ctl->oldsaved, id, UID_UNSEEN);
+           savep->val.status.num = try_nr;
        }
     }
     if (outlevel >= O_DEBUG && last_nr <= count)