1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

really_close_tab(): call number_of_tabs() only if needed.

This commit is contained in:
Laurent MONIN 2005-09-17 20:14:33 +02:00 committed by Laurent MONIN
parent 8d234b242b
commit a9f70fd776

View File

@ -159,11 +159,13 @@ static void
really_close_tab(struct session *ses) really_close_tab(struct session *ses)
{ {
struct terminal *term = ses->tab->term; struct terminal *term = ses->tab->term;
int num_tabs = number_of_tabs(term);
struct window *current_tab = get_current_tab(term); struct window *current_tab = get_current_tab(term);
if (ses->tab == current_tab) if (ses->tab == current_tab) {
int num_tabs = number_of_tabs(term);
switch_to_tab(term, term->current_tab - 1, num_tabs - 1); switch_to_tab(term, term->current_tab - 1, num_tabs - 1);
}
delete_window(ses->tab); delete_window(ses->tab);
} }