]> granicus.if.org Git - neomutt/commitdiff
Improve const-correctness
authorFederico Kircheis <federico.kircheis@gmail.com>
Wed, 7 Mar 2018 17:24:42 +0000 (18:24 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 8 Mar 2018 03:18:02 +0000 (03:18 +0000)
sidebar.c

index 0c0e8e3da58a03b0d2e3239a674bf9f69c2ad7d6..39af41502a6327147064db85a2be1054a1752dfa 100644 (file)
--- a/sidebar.c
+++ b/sidebar.c
@@ -605,15 +605,11 @@ static int select_page_up(void)
  */
 static bool prepare_sidebar(int page_size)
 {
-  struct SbEntry *opn_entry = NULL, *hil_entry = NULL;
-
   if (!EntryCount || (page_size <= 0))
     return false;
 
-  if (OpnIndex >= 0)
-    opn_entry = Entries[OpnIndex];
-  if (HilIndex >= 0)
-    hil_entry = Entries[HilIndex];
+  const struct SbEntry *opn_entry = (OpnIndex >= 0) ? Entries[OpnIndex] : NULL;
+  const struct SbEntry *hil_entry = (HilIndex >= 0) ? Entries[HilIndex] : NULL;
 
   update_entries_visibility();
   sort_entries();