From e77389e1f48ce9955011751cb1bd84c8d730aede Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Mon, 19 Nov 2018 13:14:57 +0100 Subject: [PATCH] imap: remove useless static int queued in imap_status() Only imap_mbox_open() passes true to queue parameter of imap_status(). imap_mbox_open() takes care of flushing/droppping the imap pipeline comamnds. So we don't need this extra check about queued STATUS. This change removes it. --- imap/imap.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/imap/imap.c b/imap/imap.c index 1f0734256..12d2b4acf 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -1422,7 +1422,6 @@ int imap_mailbox_check(struct Mailbox *m, bool check_stats) */ int imap_status(const char *path, bool queue) { - static int queued = 0; char buf[LONG_STRING * 2]; struct Mailbox *m = mx_mbox_find2(path); @@ -1450,15 +1449,7 @@ int imap_status(const char *path, bool queue) return -1; } - if (queue) - { - imap_exec(adata, buf, IMAP_CMD_QUEUE); - queued = 1; - return 0; - } - else if (!queued) - imap_exec(adata, buf, 0); - + imap_exec(adata, buf, queue ? IMAP_CMD_QUEUE : 0); return mdata->messages; } -- 2.40.0