On Thu, Jun 09, 2016 at 08:12:33PM -0400, Damien Riegel wrote: > move mutt_update_mailbox in mbox_sync_mailbox > > mutt_update_mailbox is executed only when we call mbox_sync_mailbox. > Moving it inside this function makes 'sync_mailbox' code simpler and > easier to factorize.
One small behavior change is that mutt_update_mailbox() is now only
called when the sync succeeds. I think this is okay.
> diff -r 9eebf8f22c4d -r 2b64e02c7d57 mbox.c
> --- a/mbox.c Tue Jun 07 18:41:40 2016 -0400
> +++ b/mbox.c Tue Jun 07 19:02:14 2016 -0400
> + if (option(OPTCHECKMBOXSIZE))
> + tmp = mutt_find_mailbox (ctx->path);
> +
> + if (tmp && tmp->new == 0)
> + mutt_update_mailbox (tmp);
> +
Before, these two blocks were separated, but now that they are joined,
it makes logical sense to put together under the if (option(OPTCHECKMBOXSIZE))
if (option(OPTCHECKMBOXSIZE))
{
tmp = mutt_find_mailbox (ctx->path);
if (tmp && tmp->new == 0)
mutt_update_mailbox (tmp);
}
--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
signature.asc
Description: PGP signature
