mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-04 14:11:59 -07:00
core: make most for loops use const references (#7527)
why not let the compiler optimise things for us at hyprspeeds when we can.
This commit is contained in:
@@ -207,7 +207,7 @@ void CMonitor::onConnect(bool noRule) {
|
||||
|
||||
// verify last mon valid
|
||||
bool found = false;
|
||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||
for (auto const& m : g_pCompositor->m_vMonitors) {
|
||||
if (m == g_pCompositor->m_pLastMonitor) {
|
||||
found = true;
|
||||
break;
|
||||
@@ -272,7 +272,7 @@ void CMonitor::onDisconnect(bool destroy) {
|
||||
listeners.commit.reset();
|
||||
|
||||
for (size_t i = 0; i < 4; ++i) {
|
||||
for (auto& ls : m_aLayerSurfaceLayers[i]) {
|
||||
for (auto const& ls : m_aLayerSurfaceLayers[i]) {
|
||||
if (ls->layerSurface && !ls->fadingOut)
|
||||
ls->layerSurface->sendClosed();
|
||||
}
|
||||
|
Reference in New Issue
Block a user