chiark / gitweb /
boot/efi: do not assign variable twice
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 9 Mar 2015 19:12:17 +0000 (15:12 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 9 Mar 2015 20:45:27 +0000 (16:45 -0400)
If the highlighted line did not move outside of the visible
region, it should not be necessary to update idx_last.

CID #1287137, #1287138.

src/boot/efi/boot.c

index 3f8140ebff0d30477258d2a997a68e33346a515d..be314d8dfbbbd5b308d5daed881d30449feb2d0c 100644 (file)
@@ -809,15 +809,12 @@ static BOOLEAN menu_run(Config *config, ConfigEntry **chosen_entry, CHAR16 *load
                         idx_last = idx_highlight;
                         idx_first = 1 + idx_highlight - visible_max;
                         refresh = TRUE;
-                }
-                if (idx_highlight < idx_first) {
+                } else if (idx_highlight < idx_first) {
                         idx_first = idx_highlight;
                         idx_last = idx_highlight + visible_max-1;
                         refresh = TRUE;
                 }
 
-                idx_last = idx_first + visible_max-1;
-
                 if (!refresh && idx_highlight != idx_highlight_prev)
                         highlight = TRUE;
         }