summaryrefslogtreecommitdiff
path: root/src/managers/input/Swipe.cpp
diff options
context:
space:
mode:
authorTom Englund <tomenglund26@gmail.com>2024-08-26 17:25:39 +0200
committerGitHub <noreply@github.com>2024-08-26 17:25:39 +0200
commit8d6c18076f3268a6c85c6085d29f898267028101 (patch)
tree9db19e850b0a3e2c5d20d5ca2ad5f9878eca89b1 /src/managers/input/Swipe.cpp
parent9c5a37a797ea1f1829859ab5b07016b2f27f739c (diff)
core: make most for loops use const references (#7527)
why not let the compiler optimise things for us at hyprspeeds when we can.
Diffstat (limited to 'src/managers/input/Swipe.cpp')
-rw-r--r--src/managers/input/Swipe.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp
index 6ee690cd..aa1d3274 100644
--- a/src/managers/input/Swipe.cpp
+++ b/src/managers/input/Swipe.cpp
@@ -14,7 +14,7 @@ void CInputManager::onSwipeBegin(IPointer::SSwipeBeginEvent e) {
return;
int onMonitor = 0;
- for (auto& w : g_pCompositor->m_vWorkspaces) {
+ for (auto const& w : g_pCompositor->m_vWorkspaces) {
if (w->m_iMonitorID == g_pCompositor->m_pLastMonitor->ID && !g_pCompositor->isWorkspaceSpecial(w->m_iID)) {
onMonitor++;
}
@@ -38,7 +38,7 @@ void CInputManager::beginWorkspaceSwipe() {
m_sActiveSwipe.speedPoints = 0;
if (PWORKSPACE->m_bHasFullscreenWindow) {
- for (auto& ls : g_pCompositor->m_pLastMonitor->m_aLayerSurfaceLayers[2]) {
+ for (auto const& ls : g_pCompositor->m_pLastMonitor->m_aLayerSurfaceLayers[2]) {
ls->alpha = 1.f;
}
}
@@ -193,7 +193,7 @@ void CInputManager::endWorkspaceSwipe() {
g_pInputManager->refocus();
// apply alpha
- for (auto& ls : g_pCompositor->m_pLastMonitor->m_aLayerSurfaceLayers[2]) {
+ for (auto const& ls : g_pCompositor->m_pLastMonitor->m_aLayerSurfaceLayers[2]) {
ls->alpha = pSwitchedTo->m_bHasFullscreenWindow && pSwitchedTo->m_efFullscreenMode == FSMODE_FULLSCREEN ? 0.f : 1.f;
}
}