mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
WindowServer: Remove uneeded const_casts for getting a submenu
This commit is contained in:
parent
41471eb3ae
commit
1048283186
Notes:
sideshowbarker
2024-07-19 06:31:20 +09:00
Author: https://github.com/shannonbooth
Commit: 1048283186
Pull-request: https://github.com/SerenityOS/serenity/pull/2282
2 changed files with 2 additions and 2 deletions
|
@ -523,7 +523,7 @@ bool Menu::is_menu_ancestor_of(const Menu& other) const
|
||||||
for (auto& item : m_items) {
|
for (auto& item : m_items) {
|
||||||
if (!item.is_submenu())
|
if (!item.is_submenu())
|
||||||
continue;
|
continue;
|
||||||
auto& submenu = *const_cast<MenuItem&>(item).submenu();
|
auto& submenu = *item.submenu();
|
||||||
if (&submenu == &other)
|
if (&submenu == &other)
|
||||||
return true;
|
return true;
|
||||||
if (submenu.is_menu_ancestor_of(other))
|
if (submenu.is_menu_ancestor_of(other))
|
||||||
|
|
|
@ -351,7 +351,7 @@ static void collect_menu_subtree(Menu& menu, Vector<Menu*>& menus)
|
||||||
auto& item = menu.item(i);
|
auto& item = menu.item(i);
|
||||||
if (!item.is_submenu())
|
if (!item.is_submenu())
|
||||||
continue;
|
continue;
|
||||||
collect_menu_subtree(*const_cast<MenuItem&>(item).submenu(), menus);
|
collect_menu_subtree(*item.submenu(), menus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue