]> granicus.if.org Git - neomutt/commitdiff
tidy reopen_mailbox
authorRichard Russon <rich@flatcap.org>
Fri, 18 Jan 2019 02:39:58 +0000 (02:39 +0000)
committerRichard Russon <rich@flatcap.org>
Fri, 8 Feb 2019 18:32:34 +0000 (18:32 +0000)
mbox/mbox.c

index 1a7adef035da12f5b576a89f0a016a6705d6934a..36c8ea1ab6f01536b2a1ed1a456bd6e55146b64f 100644 (file)
@@ -567,7 +567,6 @@ static int reopen_mailbox(struct Mailbox *m, int *index_hint)
   struct Email **old_hdrs = NULL;
   int old_msgcount;
   bool msg_mod = false;
-  bool index_hint_set;
   int i, j;
   int rc = -1;
 
@@ -659,8 +658,6 @@ static int reopen_mailbox(struct Mailbox *m, int *index_hint)
 
   /* now try to recover the old flags */
 
-  index_hint_set = (index_hint == NULL);
-
   if (!m->readonly)
   {
     for (i = 0; i < m->msg_count; i++)
@@ -699,7 +696,7 @@ static int reopen_mailbox(struct Mailbox *m, int *index_hint)
       if (found)
       {
         /* this is best done here */
-        if (!index_hint_set && *index_hint == j)
+        if (index_hint && *index_hint == j)
           *index_hint = i;
 
         if (old_hdrs[j]->changed)