1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00

do_mainmenu: get the menu's window via menu->win instead of using a

silly foreach loop
This commit is contained in:
Miciah Dashiel Butler Masters 2006-06-02 03:54:54 +00:00 committed by Miciah Dashiel Butler Masters
parent c330ae9b9c
commit cdcc8c8415

View File

@ -931,13 +931,13 @@ do_mainmenu(struct terminal *term, struct menu_item *items,
if (init) {
menu->selected = -1;
add_window(term, mainmenu_handler, menu);
foreach (win, term->windows) {
if (win->data == menu) {
del_from_list(win);
add_to_list_end(term->windows, win);
break;
}
}
win = menu->win;
/* This should be fine because add_window will call
* mainmenu_handler which will assign the window to menu->win.
*/
assert(win);
del_from_list(win);
add_to_list_end(term->windows, win);
} else {
foreach (win, term->windows) {
if (win->data == menu) {