From: Federico Kircheis Date: Wed, 7 Mar 2018 17:24:42 +0000 (+0100) Subject: Improve const-correctness X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=be1fb2ccebb51e7e5cc78681d89090c3ff585474;p=neomutt Improve const-correctness --- diff --git a/sidebar.c b/sidebar.c index 0c0e8e3da..39af41502 100644 --- 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();