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:
Tom Englund
2024-08-26 17:25:39 +02:00
committed by GitHub
parent 9c5a37a797
commit 8d6c18076f
31 changed files with 169 additions and 169 deletions

View File

@@ -137,7 +137,7 @@ bool CSessionLockManager::isSurfaceSessionLock(SP<CWLSurfaceResource> pSurface)
if (!m_pSessionLock)
return false;
for (auto& sls : m_pSessionLock->vSessionLockSurfaces) {
for (auto const& sls : m_pSessionLock->vSessionLockSurfaces) {
if (sls->surface->surface() == pSurface)
return true;
}
@@ -154,7 +154,7 @@ void CSessionLockManager::removeSessionLockSurface(SSessionLockSurface* pSLS) {
if (g_pCompositor->m_pLastFocus)
return;
for (auto& sls : m_pSessionLock->vSessionLockSurfaces) {
for (auto const& sls : m_pSessionLock->vSessionLockSurfaces) {
if (!sls->mapped)
continue;