boot/efi: do not assign variable twice

If the highlighted line did not move outside of the visible
region, it should not be necessary to update idx_last.

CID #1287137, #1287138.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2015-03-09 16:45:27 -04:00
parent 061a237dd2
commit 56c70b32af
+1 -4
View 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;
}