mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-17 04:53:48 -07:00
core: avoid .at() and use [] operator (#9347)
avoid .at() where it makes sense and use [] operator in loops.
This commit is contained in:
@@ -1626,17 +1626,17 @@ PHLWINDOW CWindow::getSwallower() {
|
||||
if (!(*PSWALLOWREGEX).empty())
|
||||
std::erase_if(candidates, [&](const auto& other) { return !RE2::FullMatch(other->m_szClass, *PSWALLOWREGEX); });
|
||||
|
||||
if (candidates.size() <= 0)
|
||||
if (candidates.size() == 0)
|
||||
return nullptr;
|
||||
|
||||
if (!(*PSWALLOWEXREGEX).empty())
|
||||
std::erase_if(candidates, [&](const auto& other) { return RE2::FullMatch(other->m_szTitle, *PSWALLOWEXREGEX); });
|
||||
|
||||
if (candidates.size() <= 0)
|
||||
if (candidates.size() == 0)
|
||||
return nullptr;
|
||||
|
||||
if (candidates.size() == 1)
|
||||
return candidates.at(0);
|
||||
return candidates[0];
|
||||
|
||||
// walk up the focus history and find the last focused
|
||||
for (auto const& w : g_pCompositor->m_vWindowFocusHistory) {
|
||||
@@ -1648,7 +1648,7 @@ PHLWINDOW CWindow::getSwallower() {
|
||||
}
|
||||
|
||||
// if none are found (??) then just return the first one
|
||||
return candidates.at(0);
|
||||
return candidates[0];
|
||||
}
|
||||
|
||||
void CWindow::unsetWindowData(eOverridePriority priority) {
|
||||
|
Reference in New Issue
Block a user