mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-09-24 20:28:28 +00:00
misc: constify the remaining for loops (#7534)
now we roll loops at blazing constified speed.
This commit is contained in:
@@ -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))
|
||||
|
Reference in New Issue
Block a user