mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:47:35 +00:00
WindowServer: Prefer structured bindings when iterating over HashMaps
This commit is contained in:
parent
773a280bdf
commit
d6c631ebe0
5 changed files with 29 additions and 32 deletions
|
@ -67,10 +67,10 @@ ConnectionFromClient::~ConnectionFromClient()
|
|||
|
||||
MenuManager::the().close_all_menus_from_client({}, *this);
|
||||
auto windows = move(m_windows);
|
||||
for (auto& window : windows) {
|
||||
window.value->detach_client({});
|
||||
if (window.value->type() == WindowType::Applet)
|
||||
AppletManager::the().remove_applet(window.value);
|
||||
for (auto& [_, window] : windows) {
|
||||
window->detach_client({});
|
||||
if (window->type() == WindowType::Applet)
|
||||
AppletManager::the().remove_applet(window);
|
||||
}
|
||||
|
||||
if (m_show_screen_number)
|
||||
|
@ -105,11 +105,10 @@ void ConnectionFromClient::set_menu_name(i32 menu_id, String const& name)
|
|||
}
|
||||
auto& menu = *it->value;
|
||||
menu.set_name(name);
|
||||
for (auto& it : m_windows) {
|
||||
auto& window = *it.value;
|
||||
window.menubar().for_each_menu([&](Menu& other_menu) {
|
||||
for (auto& [_, window] : m_windows) {
|
||||
window->menubar().for_each_menu([&](Menu& other_menu) {
|
||||
if (&menu == &other_menu) {
|
||||
window.invalidate_menubar();
|
||||
window->invalidate_menubar();
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
|
@ -126,11 +125,10 @@ void ConnectionFromClient::set_menu_minimum_width(i32 menu_id, i32 minimum_width
|
|||
}
|
||||
auto& menu = *it->value;
|
||||
menu.set_minimum_width(minimum_width);
|
||||
for (auto& it : m_windows) {
|
||||
auto& window = *it.value;
|
||||
window.menubar().for_each_menu([&](Menu& other_menu) {
|
||||
for (auto& [_, window] : m_windows) {
|
||||
window->menubar().for_each_menu([&](Menu& other_menu) {
|
||||
if (&menu == &other_menu) {
|
||||
window.invalidate_menubar();
|
||||
window->invalidate_menubar();
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue