From 8d6c18076f3268a6c85c6085d29f898267028101 Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Mon, 26 Aug 2024 17:25:39 +0200 Subject: core: make most for loops use const references (#7527) why not let the compiler optimise things for us at hyprspeeds when we can. --- src/desktop/LayerSurface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/desktop/LayerSurface.cpp') diff --git a/src/desktop/LayerSurface.cpp b/src/desktop/LayerSurface.cpp index 8d13bf19..331dba9c 100644 --- a/src/desktop/LayerSurface.cpp +++ b/src/desktop/LayerSurface.cpp @@ -72,7 +72,7 @@ CLayerSurface::~CLayerSurface() { g_pHyprRenderer->makeEGLCurrent(); std::erase_if(g_pHyprOpenGL->m_mLayerFramebuffers, [&](const auto& other) { return other.first.expired() || other.first.lock() == self.lock(); }); - for (auto& mon : g_pCompositor->m_vRealMonitors) { + for (auto const& mon : g_pCompositor->m_vRealMonitors) { for (auto& lsl : mon->m_aLayerSurfaceLayers) { std::erase_if(lsl, [this](auto& ls) { return ls.expired() || ls.get() == this; }); } -- cgit v1.2.3