From abdca388f6f0200120e244220539803b1461df28 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 7 Jul 2020 21:14:59 +0200 Subject: [PATCH] atomize & document conditions in load() exception list construction --- src/sync.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/sync.c b/src/sync.c index c9b362c..9bc08b6 100644 --- a/src/sync.c +++ b/src/sync.c @@ -1310,14 +1310,16 @@ box_opened2( sync_vars_t *svars, int t ) for (srec = svars->srecs; srec; srec = srec->next) { if (srec->status & S_DEAD) continue; - if (!srec->uid[M]) // No message; other state is irrelevant - continue; - if (minwuid > srec->uid[M] && (!(svars->opts[M] & OPEN_NEW) || svars->maxuid[M] >= srec->uid[M])) { - if (!srec->uid[S] && !(srec->status & S_PENDING)) // Only actually paired up messages matter - continue; - /* The pair is alive, but outside the bulk range. */ - *uint_array_append( &mexcs ) = srec->uid[M]; - } + if (!srec->uid[M]) + continue; // No message; other state is irrelevant + if (srec->uid[M] >= minwuid) + continue; // Message is in non-expired range + if ((svars->opts[M] & OPEN_NEW) && srec->uid[M] >= svars->maxuid[M]) + continue; // Message is in expired range, but new range overlaps that + if (!srec->uid[S] && !(srec->status & S_PENDING)) + continue; // Only actually paired up messages matter + // The pair is alive, but outside the bulk range + *uint_array_append( &mexcs ) = srec->uid[M]; } sort_uint_array( mexcs.array ); } else {