diff options
author | Andreas Kling <kling@serenityos.org> | 2021-11-05 00:43:39 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-05 01:37:00 +0100 |
commit | 5f8c949ea19fe9c9244379b5d1b7065ed670c769 (patch) | |
tree | 79e0ae4e3bdf726ace2d724e15acba19fe95bbb2 | |
parent | 1dc32fed8f44120b41650bd839be53d0aa982f8f (diff) | |
download | serenity-5f8c949ea19fe9c9244379b5d1b7065ed670c769.zip |
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.
-rw-r--r-- | Userland/Services/WindowServer/MenuManager.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Userland/Services/WindowServer/MenuManager.cpp b/Userland/Services/WindowServer/MenuManager.cpp index c1e9b88e8b..875e5b86a3 100644 --- a/Userland/Services/WindowServer/MenuManager.cpp +++ b/Userland/Services/WindowServer/MenuManager.cpp @@ -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 |