1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

WindowServer: Remove redundant check in MenuManager::open_menu()

We've already returned early if the menu is open, so there's no need to
verify that it isn't present in the stack of open menus before pushing
it onto said stack.
This commit is contained in:
Andreas Kling 2021-11-05 00:43:39 +01:00
parent 1dc32fed8f
commit 5f8c949ea1

View file

@ -303,8 +303,7 @@ void MenuManager::open_menu(Menu& menu, bool as_current_menu)
window->set_visible(true);
}
if (m_open_menu_stack.find_if([&menu](auto& other) { return &menu == other.ptr(); }).is_end())
m_open_menu_stack.append(menu);
m_open_menu_stack.append(menu);
if (as_current_menu || !current_menu()) {
// Only make this menu the current menu if requested, or if no