1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-11 05:29:28 -04:00

Replace a loop with arithmetic in move_current_tab

This commit is contained in:
Miciah Dashiel Butler Masters 2006-05-15 20:00:27 +00:00 committed by Miciah Dashiel Butler Masters
parent 3ee31b956a
commit 739298b46d

View File

@ -308,8 +308,8 @@ move_current_tab(struct session *ses, int direction)
new_pos = term->current_tab + direction;
if (get_opt_bool("ui.tabs.wraparound")) {
while (new_pos < 0 || new_pos >= tabs)
new_pos += new_pos < 0 ? tabs : -tabs;
new_pos %= tabs;
if (new_pos < 0) new_pos = tabs + new_pos;
} else {
int_bounds(&new_pos, 0, tabs - 1);
}