diff options
| author | Tom Englund <tomenglund26@gmail.com> | 2024-08-26 20:24:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-26 20:24:30 +0200 |
| commit | 72c7818ae66a18d126e2b4245d649fe3a93d3b8e (patch) | |
| tree | 194361ee0d4f92eea809b7904d39f02793c55e13 /src/protocols/core/Compositor.cpp | |
| parent | 1ea47950f4262ec1215087948c7275f8e0115af2 (diff) | |
misc: constify the remaining for loops (#7534)
now we roll loops at blazing constified speed.
Diffstat (limited to 'src/protocols/core/Compositor.cpp')
| -rw-r--r-- | src/protocols/core/Compositor.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp index 75f1e646..f7f6dcda 100644 --- a/src/protocols/core/Compositor.cpp +++ b/src/protocols/core/Compositor.cpp @@ -241,7 +241,7 @@ void CWLSurfaceResource::frame(timespec* now) { if (callbacks.empty()) return; - for (auto& c : callbacks) { + for (auto const& c : callbacks) { c->send(now); } @@ -257,7 +257,7 @@ void CWLSurfaceResource::bfHelper(std::vector<SP<CWLSurfaceResource>> nodes, std std::vector<SP<CWLSurfaceResource>> nodes2; // first, gather all nodes below - for (auto& n : nodes) { + for (auto const& n : nodes) { std::erase_if(n->subsurfaces, [](const auto& e) { return e.expired(); }); // subsurfaces is sorted lowest -> highest for (auto const& c : n->subsurfaces) { @@ -310,7 +310,7 @@ std::pair<SP<CWLSurfaceResource>, Vector2D> CWLSurfaceResource::at(const Vector2 void* data) { ((std::vector<std::pair<SP<CWLSurfaceResource>, Vector2D>>*)data)->emplace_back(std::make_pair<>(surf, offset)); }, &surfs); - for (auto& [surf, pos] : surfs | std::views::reverse) { + for (auto const& [surf, pos] : surfs | std::views::reverse) { if (!allowsInput) { const auto BOX = CBox{pos, surf->current.size}; if (BOX.containsPoint(localCoords)) |
